converted the constant filter to a function

This commit is contained in:
Fabien Potencier
2010-12-20 08:40:02 +01:00
parent 8fe302bb3e
commit 47a73476e0
5 changed files with 21 additions and 15 deletions
+9 -9
View File
@@ -1303,15 +1303,6 @@ the last filter applied to it.
{{ var|raw }} {# var won't be escaped #}
{% autoescape off %}
``constant`` (new in Twig 0.9.9)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
``constant`` returns the constant value for a given string:
.. code-block:: jinja
{{ some_date|date('DATE_W3C'|constant) }}
``merge`` (new in Twig 0.9.10)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -1456,6 +1447,15 @@ step of 1):
{{ i }},
{% endfor %}
``constant``
~~~~~~~~~~~~
``constant`` returns the constant value for a given string:
.. code-block:: jinja
{{ some_date|date(constant('DATE_W3C')) }}
Extensions
----------