@dump - Debugging Variables
The @dump directive in Ahmed PHP Template Engine allows you to output detailed information about variables for debugging purposes. It is similar to PHP's var_dump() but formatted for better readability within the template.
Syntax
@dump(variable)variableis the variable you want to inspect.It prints the value and type of the variable directly within the template.
Example
@set(user, ['name' => 'Ammar', 'age' => 13])
@dump(user)Output
array(
"name" => "Ammar",
"age" => 13
)Notes
@dumpis useful for debugging arrays, objects, and other complex data structures.It should be removed in production templates to avoid exposing internal data.
Can be combined with
@setfor testing variable values.
Last updated