Skip to content

Commit

Permalink
[DOCS] Add chapter about _all variable
Browse files Browse the repository at this point in the history
  • Loading branch information
s2b committed Jan 21, 2025
1 parent 34af415 commit 40f652c
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions Documentation/Usage/Variables.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

.. _variables:

===============
=========
Variables
===============
=========

Assign a variable in PHP:

Expand All @@ -27,6 +27,22 @@ The result:
In the template's HTML code, wrap the variable name into curly
braces to output it.

.. _variable-all:

Special _all Variable
=========================

The special variable `{_all}` contains an array with all variables that are currently
defined in your template. This can be helpful for debugging purposes, but also if you
want to pass all variables to a partial:

.. code-block:: xml
<f:render partial="MyPartial" arguments="{_all}" />
However, be advised that this makes it more difficult to re-use partials, so it's recommend
to only pass the variables that are actually needed in the partial.

.. _variable-scopes:

Variable Scopes
Expand Down

0 comments on commit 40f652c

Please sign in to comment.