Available Smarty Functions

Article Topics: Smarty

Available Built-in Smarty Functions:

  • count

  • strtolower

  • strtoupper

  • number_format

  • date_format

  • array

  • list

  • isset

  • empty

  • sizeof

  • in_array

  • is_array

  • is_numeric

  • true

  • false

  • strlen

  • strpos

  • nl2br

  • array_key_exists

Available TMM Smarty Modifiers:

  • dhms : Used to get the days:hours:minutes:seconds from seconds

  • tmm_abbreviate : Used to abbreviate a string

  • maxlength : Used to restrict a string to the max length

  • ucwords : Used to convert the first character of each word in a string to uppercase

  • currency_format : used to display a number in its proper currency format

  • currency_format_cents : Used to display a number in its proper currency format where currency is in cents

  • math_opposite : Used to change the sign for a number

  • bytes : Used to format a number of bytes into a readable number

  • long2ip : Used to convert a long integer address into a string in (IPv4) Internet standard dotted format

  • convlang : Used to take in a string and find the valid language version

  • tmm_strpos : Used to return the position of the first occurrence of a string inside another string

  • tmm_strstr : Used to get the first occurrence of a string inside another string

  • tmm_substr : Used to cut a part of a string from a string, starting at a specified position.

  • rand : Used to get a random number with a min and max limit

Last updated

Was this helpful?