diff --git a/doc/api.rst b/doc/api.rst index cb2110c05..5f0da7b5b 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 e967dd477..bc5e46f84 100644 --- a/doc/tags/import.rst +++ b/doc/tags/import.rst @@ -30,7 +30,7 @@ That way you can access the attributes:
{{ forms.textarea('comment') }}
diff --git a/doc/tags/macro.rst b/doc/tags/macro.rst index 01bf6257e..3d920e31c 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 f8386ec56..c4599df1c 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 69d4be713..b16edc53a 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 8b59dd194..44eec62e5 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``.