@@ -22,29 +22,30 @@ class TwigPrintExtension extends AbstractExtension
2222 */
2323 public function getFunctions ()
2424 {
25+ $ options = ['is_safe ' => ['html ' ]];
2526 return array (
26- 'echo_twig ' => new TwigFunction ('echo_twig ' , array ($ this , 'getEchoTwig ' )),
27- 'echo_block ' => new TwigFunction ('echo_block ' , array ($ this , 'getEchoBlock ' )),
28- 'echo_endblock ' => new TwigFunction ('echo_endblock ' , array ($ this , 'getEchoEndBlock ' )),
29- 'echo_for ' => new TwigFunction ('echo_for ' , array ($ this , 'getEchoFor ' )),
30- 'echo_endfor ' => new TwigFunction ('echo_endfor ' , array ($ this , 'getEchoEndFor ' )),
31- 'echo_raw ' => new TwigFunction ('echo_raw ' , array ($ this , 'getEchoRaw ' )),
32- 'echo_endraw ' => new TwigFunction ('echo_endraw ' , array ($ this , 'getEchoEndRaw ' )),
33- 'echo_spaceless ' => new TwigFunction ('echo_spaceless ' , array ($ this , 'getEchoSpaceless ' )),
34- 'echo_endspaceless ' => new TwigFunction ('echo_endspaceless ' , array ($ this , 'getEchoEndSpaceless ' )),
35- 'echo_extends ' => new TwigFunction ('echo_extends ' , array ($ this , 'getEchoExtends ' )),
36- 'echo_if ' => new TwigFunction ('echo_if ' , array ($ this , 'getEchoIf ' )),
37- 'echo_else ' => new TwigFunction ('echo_else ' , array ($ this , 'getEchoElse ' )),
38- 'echo_elseif ' => new TwigFunction ('echo_elseif ' , array ($ this , 'getEchoElseIf ' )),
39- 'echo_endif ' => new TwigFunction ('echo_endif ' , array ($ this , 'getEchoEndIf ' )),
40- 'echo_set ' => new TwigFunction ('echo_set ' , array ($ this , 'getEchoSet ' )),
41- 'echo_twig_arr ' => new TwigFunction ('echo_twig_arr ' , array ($ this , 'getEchoTwigArr ' )),
42- 'echo_twig_assoc ' => new TwigFunction ('echo_twig_assoc ' , array ($ this , 'getEchoTwigAssoc ' )),
43- 'echo_twig_filter ' => new TwigFunction ('echo_twig_filter ' , array ($ this , 'getEchoTwigFilter ' )),
44- 'echo_include ' => new TwigFunction ('echo_include ' , array ($ this , 'getEchoInclude ' )),
45- 'echo_use ' => new TwigFunction ('echo_use ' , array ($ this , 'getEchoUse ' )),
46- 'echo_print_block ' => new TwigFunction ('echo_print_block ' , array ($ this , 'getEchoPrintBlock ' )),
47- 'char ' => new TwigFunction ('char ' , array ($ this , 'char ' )),
27+ 'echo_twig ' => new TwigFunction ('echo_twig ' , array ($ this , 'getEchoTwig ' ), $ options ),
28+ 'echo_block ' => new TwigFunction ('echo_block ' , array ($ this , 'getEchoBlock ' ), $ options ),
29+ 'echo_endblock ' => new TwigFunction ('echo_endblock ' , array ($ this , 'getEchoEndBlock ' ), $ options ),
30+ 'echo_for ' => new TwigFunction ('echo_for ' , array ($ this , 'getEchoFor ' ), $ options ),
31+ 'echo_endfor ' => new TwigFunction ('echo_endfor ' , array ($ this , 'getEchoEndFor ' ), $ options ),
32+ 'echo_raw ' => new TwigFunction ('echo_raw ' , array ($ this , 'getEchoRaw ' ), $ options ),
33+ 'echo_endraw ' => new TwigFunction ('echo_endraw ' , array ($ this , 'getEchoEndRaw ' ), $ options ),
34+ 'echo_spaceless ' => new TwigFunction ('echo_spaceless ' , array ($ this , 'getEchoSpaceless ' ), $ options ),
35+ 'echo_endspaceless ' => new TwigFunction ('echo_endspaceless ' , array ($ this , 'getEchoEndSpaceless ' ), $ options ),
36+ 'echo_extends ' => new TwigFunction ('echo_extends ' , array ($ this , 'getEchoExtends ' ), $ options ),
37+ 'echo_if ' => new TwigFunction ('echo_if ' , array ($ this , 'getEchoIf ' ), $ options ),
38+ 'echo_else ' => new TwigFunction ('echo_else ' , array ($ this , 'getEchoElse ' ), $ options ),
39+ 'echo_elseif ' => new TwigFunction ('echo_elseif ' , array ($ this , 'getEchoElseIf ' ), $ options ),
40+ 'echo_endif ' => new TwigFunction ('echo_endif ' , array ($ this , 'getEchoEndIf ' ), $ options ),
41+ 'echo_set ' => new TwigFunction ('echo_set ' , array ($ this , 'getEchoSet ' ), $ options ),
42+ 'echo_twig_arr ' => new TwigFunction ('echo_twig_arr ' , array ($ this , 'getEchoTwigArr ' ), $ options ),
43+ 'echo_twig_assoc ' => new TwigFunction ('echo_twig_assoc ' , array ($ this , 'getEchoTwigAssoc ' ), $ options ),
44+ 'echo_twig_filter ' => new TwigFunction ('echo_twig_filter ' , array ($ this , 'getEchoTwigFilter ' ), $ options ),
45+ 'echo_include ' => new TwigFunction ('echo_include ' , array ($ this , 'getEchoInclude ' ), $ options ),
46+ 'echo_use ' => new TwigFunction ('echo_use ' , array ($ this , 'getEchoUse ' ), $ options ),
47+ 'echo_print_block ' => new TwigFunction ('echo_print_block ' , array ($ this , 'getEchoPrintBlock ' ), $ options ),
48+ 'char ' => new TwigFunction ('char ' , array ($ this , 'char ' ), $ options ),
4849 );
4950 }
5051
0 commit comments