mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-13 19:06:40 +00:00
fixed if tag documentation
This commit is contained in:
+7
-3
@@ -604,9 +604,8 @@ course this is not limited to commas:
|
||||
If
|
||||
~~
|
||||
|
||||
The ``if`` statement in Twig is comparable with the if statements of PHP. In the
|
||||
simplest form you can use it to test if a variable is defined, not empty or
|
||||
not false:
|
||||
The ``if`` statement in Twig is comparable with the if statements of PHP. In
|
||||
the simplest form you can use it to test if a variable is not empty:
|
||||
|
||||
.. code-block:: jinja
|
||||
|
||||
@@ -618,6 +617,11 @@ not false:
|
||||
</ul>
|
||||
{% endif %}
|
||||
|
||||
.. note::
|
||||
|
||||
If you want to test if the variable is defined, use ``if users is
|
||||
defined`` instead.
|
||||
|
||||
For multiple branches ``elseif`` and ``else`` can be used like in PHP. You can use
|
||||
more complex ``expressions`` there too:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user