clarified documentation of pre_escape option

This commit is contained in:
Andreas Hucks
2012-06-25 19:09:27 +02:00
parent 4679ad51c5
commit f8406701e5
+4 -2
View File
@@ -243,8 +243,10 @@ case, set the ``is_safe`` option::
$filter = new Twig_Filter_Function('nl2br', array('is_safe' => array('html')));
Some filters may have to work on already escaped or safe values. In such a
case, set the ``pre_escape`` option::
Some filters may need to work on input that is already escaped or safe, for
example when adding (safe) html tags to originally unsafe output. In such a
case, set the ``pre_escape`` option to escape the input data before it is run
through your filter::
$filter = new Twig_Filter_Function('somefilter', array('pre_escape' => 'html', 'is_safe' => array('html')));