mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-21 07:37:43 +00:00
15 lines
363 B
ReStructuredText
15 lines
363 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"}) }}
|
|
|
|
{# returns I like foo and bar
|
|
if the foo parameter equals to the foo string. #}
|
|
|
|
.. seealso:: :doc:`format<format>`
|