mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-11 18:06:46 +00:00
@@ -1,3 +1,7 @@
|
||||
* 1.7.0 (2012-XX-XX)
|
||||
|
||||
* added a trim filter
|
||||
|
||||
* 1.6.1 (2012-02-29)
|
||||
|
||||
* fixed Twig C extension
|
||||
|
||||
@@ -137,6 +137,7 @@ class Twig_Extension_Core extends Twig_Extension
|
||||
'upper' => new Twig_Filter_Function('strtoupper'),
|
||||
'lower' => new Twig_Filter_Function('strtolower'),
|
||||
'striptags' => new Twig_Filter_Function('strip_tags'),
|
||||
'trim' => new Twig_Filter_Function('trim'),
|
||||
'nl2br' => new Twig_Filter_Function('nl2br', array('pre_escape' => 'html', 'is_safe' => array('html'))),
|
||||
|
||||
// array helpers
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
--TEST--
|
||||
"trim" filter
|
||||
--TEMPLATE--
|
||||
{{ " I like Twig. "|trim }}
|
||||
{{ text|trim }}
|
||||
{{ " foo/"|trim("/") }}
|
||||
--DATA--
|
||||
return array('text' => " If you have some <strong>HTML</strong> it will be escaped. ")
|
||||
--EXPECT--
|
||||
I like Twig.
|
||||
If you have some <strong>HTML</strong> it will be escaped.
|
||||
foo
|
||||
Reference in New Issue
Block a user