Files
Twig/doc/filters/replace.rst
T
2013-11-23 21:51:26 +01:00

20 lines
429 B
ReStructuredText

``replace``
===========
The ``replace`` filter formats a given string by replacing the placeholders
(placeholders are free-form):
.. code-block:: jinja
{{ "I like %this% and %that%."|replace({'%this%': foo, '%that%': "bar"}) }}
{# outputs I like foo and bar
if the foo parameter equals to the foo string. #}
Arguments
---------
* ``replace_pairs``: The placeholder values
.. seealso:: :doc:`format<format>`