changed the documentation to advertize null as begin the null value and none as an alias

This commit is contained in:
Fabien Potencier
2011-10-29 14:53:37 +02:00
parent dfdd555b9a
commit 8d00b42e56
6 changed files with 13 additions and 9 deletions
+1 -1
View File
@@ -300,7 +300,7 @@ The ``core`` extension defines all the core features of Twig:
* ``odd``
* ``defined``
* ``sameas``
* ``none``
* ``null``
* ``divisibleby``
* ``constant``
* ``empty``
+1 -1
View File
@@ -30,7 +30,7 @@ That way you can access the attributes:
<dt>Username</dt>
<dd>{{ forms.input('username') }}</dd>
<dt>Password</dt>
<dd>{{ forms.input('password', none, 'password') }}</dd>
<dd>{{ forms.input('password', null, 'password') }}</dd>
</dl>
<p>{{ forms.textarea('comment') }}</p>
+1 -1
View File
@@ -45,7 +45,7 @@ The macro can then be called at will:
.. code-block:: jinja
<p>{{ forms.input('username') }}</p>
<p>{{ forms.input('password', none, 'password') }}</p>
<p>{{ forms.input('password', null, 'password') }}</p>
If macros are defined and used in the same template, you can use the
special ``_self`` variable, without importing them:
+2 -2
View File
@@ -480,8 +480,8 @@ exist:
* ``true`` / ``false``: ``true`` represents the true value, ``false``
represents the false value.
* ``none``: ``none`` represents no specific value (the equivalent of ``null`` in
PHP). This is the value returned when a variable does not exist.
* ``null``: ``null`` represents no specific value. This is the value returned
when a variable does not exist. ``none`` is an alias for ``null``.
Arrays and hashes can be nested:
+1 -1
View File
@@ -5,7 +5,7 @@ Tests
:maxdepth: 1
divisibleby
none
null
even
odd
sameas
+7 -3
View File
@@ -1,8 +1,12 @@
``none``
``null``
========
``none`` returns ``true`` if the variable is ``none``:
``null`` returns ``true`` if the variable is ``null``:
.. code-block:: jinja
{{ var is none }}
{{ var is null }}
.. note::
``none`` is an alias for ``null``.