From fbacbe60ada8c7b1978474da19391fda1ffedcc5 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Thu, 5 Apr 2012 22:53:25 +0200 Subject: [PATCH] added some more information about unknown variable/attributes in the doc (closes #685) --- doc/api.rst | 2 ++ doc/templates.rst | 4 +++- 2 files changed, 5 insertions(+), 1 deletions(-) diff --git a/doc/api.rst b/doc/api.rst index 864585e..445b8a7 100644 --- a/doc/api.rst +++ b/doc/api.rst @@ -60,6 +60,8 @@ You can also load and render the template in one fell swoop:: echo $twig->render('index.html', array('the' => 'variables', 'go' => 'here')); +.. _environment_options: + Environment Options ------------------- diff --git a/doc/templates.rst b/doc/templates.rst index bcd0ead..8813c6d 100644 --- a/doc/templates.rst +++ b/doc/templates.rst @@ -78,7 +78,9 @@ properties of a PHP object, or items of a PHP array), or the so-called variable but the print statement. If you access variables inside tags don't put the braces around. -If a variable or attribute does not exist you will get back a ``null`` value. +If a variable or attribute does not exist, you will get back a ``null`` value +when the ``strict_variables`` option is set to ``false``, otherwise Twig will +throw an error (see :ref:`environment options`). .. sidebar:: Implementation -- 1.7.2.5