/libs/plugins/modifier.truncate.php

Description

Smarty plugin

Functions
smarty_modifier_truncate (line 27)

Smarty truncate modifier plugin

Type: modifier
Name: truncate
Purpose: Truncate a string to a certain length if necessary, optionally splitting in the middle of a word, and appending the $etc string or inserting $etc into the middle.

string smarty_modifier_truncate (string $string, [integer $length = 80], [string $etc = '...'], [boolean $break_words = false], [boolean $middle = false])
  • string $string: input string
  • integer $length: length of truncated text
  • string $etc: end string
  • boolean $break_words: truncate at word boundary
  • boolean $middle: truncate in the middle of text

Documentation generated on Sat, 24 Sep 2011 20:23:14 +0200 by phpDocumentor 1.4.1