smarty_modifier_capitalize
smarty_modifier_date_format
smarty_modifier_escape
smarty_modifier_regex_replace
smarty_modifier_replace
smarty_modifier_spacify
smarty_modifier_truncate
smarty_modifier_capitalize(string $string, boolean $uc_digits, boolean $lc_rest) : string
Type: modifier
Name: capitalize
Purpose: capitalize words in the string
author | Monte Ohrt <monte at ohrt dot com> |
---|---|
author | Rodney Rehm |
string
string to capitalize
boolean
also capitalize "x123" to "X123"
boolean
capitalize first letters, lowercase all following letters "aAa" to "Aaa"
string
capitalized stringsmarty_modifier_date_format(string $string, string $format, string $default_date, string $formatter) : string
Type: modifier
Name: date_format
Purpose: format datestamps via strftime
Input:
- string: input date string
- format: strftime format for output
- default_date: default date if $string is empty
link | date_format (Smarty online manual) |
---|---|
author | Monte Ohrt <monte at ohrt dot com> |
uses | \global\smarty_make_timestamp() |
string
input date string
string
strftime format for output
string
default date if $string is empty
string
either 'strftime' or 'auto'
string
|voidsmarty_modifier_escape(string $string, string $esc_type, string $char_set, boolean $double_encode) : string
Type: modifier
Name: escape
Purpose: escape string for output
link | count_characters (Smarty online manual) |
---|---|
author | Monte Ohrt <monte at ohrt dot com> |
string
input string
string
escape type
string
character set, used for htmlspecialchars() or htmlentities()
boolean
encode already encoded entitites again, used for htmlspecialchars() or htmlentities()
string
escaped input stringsmarty_modifier_regex_replace(string $string, string | array $search, string | array $replace) : string
Type: modifier
Name: regex_replace
Purpose: regular expression search/replace
link | regex_replace (Smarty online manual) |
---|---|
author | Monte Ohrt <monte at ohrt dot com> |
string
input string
string
array
regular expression(s) to search for
string
array
string(s) that should be replaced
string
smarty_modifier_replace(string $string, string $search, string $replace) : string
Type: modifier
Name: replace
Purpose: simple search/replace
link | replace (Smarty online manual) |
---|---|
author | Monte Ohrt <monte at ohrt dot com> |
author | Uwe Tews |
string
input string
string
text to search for
string
replacement text
string
smarty_modifier_spacify(string $string, string $spacify_char) : string
Type: modifier
Name: spacify
Purpose: add spaces between characters in a string
link | spacify (Smarty online manual) |
---|---|
author | Monte Ohrt <monte at ohrt dot com> |
string
input string
string
string to insert between characters.
string
smarty_modifier_truncate(string $string, integer $length, string $etc, boolean $break_words, boolean $middle) : string
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.
link | truncate (Smarty online manual) |
---|---|
author | Monte Ohrt <monte at ohrt dot com> |
string
input string
integer
length of truncated text
string
end string
boolean
truncate at word boundary
boolean
truncate in the middle of text
string
truncated string