From 40f652cca8753a3907b98c5fa89ec99af22c8734 Mon Sep 17 00:00:00 2001 From: Simon Praetorius Date: Thu, 16 Jan 2025 16:42:39 +0100 Subject: [PATCH] [DOCS] Add chapter about _all variable --- Documentation/Usage/Variables.rst | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/Documentation/Usage/Variables.rst b/Documentation/Usage/Variables.rst index 1370b355..b1066d4c 100644 --- a/Documentation/Usage/Variables.rst +++ b/Documentation/Usage/Variables.rst @@ -2,9 +2,9 @@ .. _variables: -=============== +========= Variables -=============== +========= Assign a variable in PHP: @@ -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 + + + +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