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 |
stringstring to capitalize
booleanalso capitalize "x123" to "X123"
booleancapitalize first letters, lowercase all following letters "aAa" to "Aaa"
stringcapitalized 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() |
stringinput date string
stringstrftime format for output
stringdefault date if $string is empty
stringeither '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> |
stringinput string
stringescape type
stringcharacter set, used for htmlspecialchars() or htmlentities()
booleanencode already encoded entitites again, used for htmlspecialchars() or htmlentities()
stringescaped 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> |
stringinput string
stringarrayregular expression(s) to search for
stringarraystring(s) that should be replaced
stringsmarty_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 |
stringinput string
stringtext to search for
stringreplacement text
stringsmarty_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> |
stringinput string
stringstring to insert between characters.
stringsmarty_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> |
stringinput string
integerlength of truncated text
stringend string
booleantruncate at word boundary
booleantruncate in the middle of text
stringtruncated string