Yaffs site version 1.1
[yaffs-website] / vendor / twig / twig / doc / filters / replace.rst
1 ``replace``
2 ===========
3
4 The ``replace`` filter formats a given string by replacing the placeholders
5 (placeholders are free-form):
6
7 .. code-block:: jinja
8
9     {{ "I like %this% and %that%."|replace({'%this%': foo, '%that%': "bar"}) }}
10
11     {# outputs I like foo and bar
12        if the foo parameter equals to the foo string. #}
13
14 Arguments
15 ---------
16
17 * ``from``: The placeholder values
18
19 .. seealso:: :doc:`format<format>`