{
function twig_truncate_filter(
Twig_Environment $env, $value, $length = 30, $preserve =
false, $separator =
'...')
{
if (strlen($value) > $length) {
if ($preserve) {
if (false !== ($breakpoint = strpos($value, ' ', $length))) {
$length = $breakpoint;
}
}
return rtrim(substr($value, 0, $length)).$separator;
}
return $value;
}
function twig_wordwrap_filter(
Twig_Environment $env, $value, $length = 80, $separator =
"\n", $preserve =
false)
{
return wordwrap($value, $length, $separator, !$preserve);
}
}
class_alias('Twig_Extensions_Extension_Text', 'Twig\Extensions\TextExtension', false)
Stores the Twig configuration.