refactored documentation

This commit is contained in:
Fabien Potencier
2011-09-26 23:40:44 +02:00
parent d65366e772
commit b096e21daa
53 changed files with 1705 additions and 1273 deletions
+18
View File
@@ -0,0 +1,18 @@
``default``
===========
The ``default`` filter returns the passed default value if the value is
undefined or empty, otherwise the value of the variable:
.. code-block:: jinja
{{ var|default('var is not defined') }}
{{ var.foo|default('foo item on var is not defined') }}
{{ ''|default('passed var is empty') }}
.. note::
Read the documentation for the :doc:`defined<../tests/defined>` and
:doc:`empty<../tests/empty>` tests to learn more about their semantics.