From: Fabien Potencier Date: Sat, 29 Oct 2011 12:53:37 +0000 (+0200) Subject: changed the documentation to advertize null as begin the null value and none as an... X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=8d00b42e569f469e4e0934f87f82111560da8ac3;p=web%2Fkonrad%2Ftwig.git changed the documentation to advertize null as begin the null value and none as an alias --- diff --git a/doc/api.rst b/doc/api.rst index cb2110c..5f0da7b 100644 --- a/doc/api.rst +++ b/doc/api.rst @@ -300,7 +300,7 @@ The ``core`` extension defines all the core features of Twig: * ``odd`` * ``defined`` * ``sameas`` - * ``none`` + * ``null`` * ``divisibleby`` * ``constant`` * ``empty`` diff --git a/doc/tags/import.rst b/doc/tags/import.rst index e967dd4..bc5e46f 100644 --- a/doc/tags/import.rst +++ b/doc/tags/import.rst @@ -30,7 +30,7 @@ That way you can access the attributes:
Username
{{ forms.input('username') }}
Password
-
{{ forms.input('password', none, 'password') }}
+
{{ forms.input('password', null, 'password') }}

{{ forms.textarea('comment') }}

diff --git a/doc/tags/macro.rst b/doc/tags/macro.rst index 01bf625..3d920e3 100644 --- a/doc/tags/macro.rst +++ b/doc/tags/macro.rst @@ -45,7 +45,7 @@ The macro can then be called at will: .. code-block:: jinja

{{ forms.input('username') }}

-

{{ forms.input('password', none, 'password') }}

+

{{ forms.input('password', null, 'password') }}

If macros are defined and used in the same template, you can use the special ``_self`` variable, without importing them: diff --git a/doc/templates.rst b/doc/templates.rst index f8386ec..c4599df 100644 --- a/doc/templates.rst +++ b/doc/templates.rst @@ -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: diff --git a/doc/tests/index.rst b/doc/tests/index.rst index 69d4be7..b16edc5 100644 --- a/doc/tests/index.rst +++ b/doc/tests/index.rst @@ -5,7 +5,7 @@ Tests :maxdepth: 1 divisibleby - none + null even odd sameas diff --git a/doc/tests/none.rst b/doc/tests/none.rst index 8b59dd1..44eec62 100644 --- a/doc/tests/none.rst +++ b/doc/tests/none.rst @@ -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``.