Truncate
class Truncate extends Twig_Extension
A Tiwg extension that truncates text while preservice HTML tags.
Based on http://alanwhipple.com/2011/05/25/php-truncate-string-preserving-html-tags-words/
Methods
getFilters()
No description
getName()
No description
string
truncate(string $text, integer $length = 100, string $ending = '...', boolean $exact = false, boolean $considerHtml = true)
Truncates a string up to a number of characters while preserving whole words and HTML tags
Details
at line 14
getFilters()
at line 27
getName()
at line 43
string
truncate(string $text, integer $length = 100, string $ending = '...', boolean $exact = false, boolean $considerHtml = true)
Truncates a string up to a number of characters while preserving whole words and HTML tags