@var - Define and Use Variables
The @var
directive in Ahmed PHP Template Engine allows you to define and store variables within your template.
Syntax
variableName
: The name of the variable.value
: The value to assign to the variable.
Description
This directive sets a variable to be used later in the template.
Supports strings, numbers, and expressions.
Variables can be accessed using
@variableName
.
Example
Expected Output
Notes
Variables persist throughout the template unless redefined.
Supports dynamic values and calculations (e.g.,
@var(total, price * quantity)
).
Last updated