blob: 782ea75cc636b7065b0fb9dcfbe8f65e4b219b8a [file] [log] [blame]
Matthias Andreas Benkard12a57352021-12-28 18:02:04 +01001``format``
2==========
3
4The ``format`` filter formats a given string by replacing the placeholders
5(placeholders follows the `sprintf`_ notation):
6
7.. code-block:: twig
8
9 {{ "I like %s and %s."|format(foo, "bar") }}
10
11 {# outputs I like foo and bar
12 if the foo parameter equals to the foo string. #}
13
14.. seealso::
15
16 :doc:`replace<replace>`
17
18.. _`sprintf`: https://secure.php.net/sprintf