Skip to content

Commit 3547418

Browse files
ybenhssaienjaviereguiluz
authored andcommitted
Throw Exception if twig variable is not found
An exception of type `Twig\Error\RuntimeError` is thrown when a variable is not found and `strict_variables` is enabled
1 parent c732edf commit 3547418

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

templates.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ in the following order:
164164
#. ``$foo->getBar()`` (object and *getter* method);
165165
#. ``$foo->isBar()`` (object and *isser* method);
166166
#. ``$foo->hasBar()`` (object and *hasser* method);
167-
#. If none of the above exists, use ``null``.
167+
#. If none of the above exists, use ``null`` or throw a ``Twig\Error\RuntimeError`` exception if ``strict_variables`` config is enabled.
168168

169169
This allows to evolve your application code without having to change the
170170
template code (you can start with array variables for the application proof of

0 commit comments

Comments
 (0)