Source for file modifier.truncate.php
Documentation is available at modifier.truncate.php
* Smarty truncate modifier plugin
* Purpose: Truncate a string to a certain length if necessary,
* optionally splitting in the middle of a word, and
* appending the $etc string.
* @link http://smarty.php.net/manual/en/language.modifier.truncate.php
* truncate (Smarty online manual)
if (strlen($string) > $length) {
return substr($string, 0, $length). $etc;
/* vim: set expandtab: */
|