mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-21 07:37:43 +00:00
converted the constant filter to a function
This commit is contained in:
+9
-9
@@ -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
|
||||
----------
|
||||
|
||||
|
||||
Reference in New Issue
Block a user