From: Fabien Potencier Date: Tue, 14 Dec 2010 08:16:13 +0000 (+0100) Subject: tweaked doc X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=9bcf7719d1a9569ab7c989e826c13311bae8b1bd;p=web%2Fkonrad%2Ftwig.git tweaked doc --- diff --git a/doc/02-Twig-for-Template-Designers.markdown b/doc/02-Twig-for-Template-Designers.markdown index 68a096c..9adde3d 100644 --- a/doc/02-Twig-for-Template-Designers.markdown +++ b/doc/02-Twig-for-Template-Designers.markdown @@ -1079,8 +1079,8 @@ The `format` filter formats a given string by replacing the placeholders (placeholders follows the `printf` notation): [twig] - {# string is a format string like: #} - {{ string|format(foo, "bar") }} + {{ "I like %s and %s."|format(foo, "bar") }} + {# returns I like foo and bar. (if the foo parameter equals to the foo string) #} ### `replace` (new in Twig 0.9.9) @@ -1089,8 +1089,8 @@ The `replace` filter formats a given string by replacing the placeholders (placeholders are free-form): [twig] - {# string is a format string like: I like %this% and %that%. #} - {{ string|replace({'%this%': foo, '%that%': "bar"}) }} + {{ "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) #} ### `cycle`