mirror of
https://github.com/twigphp/Twig.git
synced 2026-11-12 21:37:05 +00:00
c8f69d764b
The argument name in the code is $from See https://github.com/jean-pasqualini/Twig/blob/1.x/lib/Twig/Extension/Core.php#L475. Issue : https://github.com/twigphp/Twig/issues/2329
20 lines
420 B
ReStructuredText
20 lines
420 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
|
|
---------
|
|
|
|
* ``from``: The placeholder values
|
|
|
|
.. seealso:: :doc:`format<format>`
|