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.
Parameters | |||
---|---|---|---|
string
|
$string |
input string |
# |
integer
|
$length = 80 |
length of truncated text |
# |
string
|
$etc = '...' |
end string |
# |
boolean
|
$break_words = false |
truncate at word boundary |
# |
boolean
|
$middle = false |
truncate in the middle of text |
# |
Returns | |
---|---|
string
|
truncated string |