diff options
Diffstat (limited to 'vendor/twig/twig/doc/filters/format.rst')
-rw-r--r-- | vendor/twig/twig/doc/filters/format.rst | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/vendor/twig/twig/doc/filters/format.rst b/vendor/twig/twig/doc/filters/format.rst new file mode 100644 index 00000000..fe55a09e --- /dev/null +++ b/vendor/twig/twig/doc/filters/format.rst | |||
@@ -0,0 +1,16 @@ | |||
1 | ``format`` | ||
2 | ========== | ||
3 | |||
4 | The ``format`` filter formats a given string by replacing the placeholders | ||
5 | (placeholders follows the `sprintf`_ notation): | ||
6 | |||
7 | .. code-block:: jinja | ||
8 | |||
9 | {{ "I like %s and %s."|format(foo, "bar") }} | ||
10 | |||
11 | {# returns I like foo and bar | ||
12 | if the foo parameter equals to the foo string. #} | ||
13 | |||
14 | .. _`sprintf`: http://www.php.net/sprintf | ||
15 | |||
16 | .. seealso:: :doc:`replace<replace>` | ||