Built-in Filters
abs
Theabs filter returns the absolute value of a number.
Syntax
number_value(number): The input number.
capitalize
Thecapitalize filter capitalizes the first character of a string.
Syntax
string_value(string): The input string to be capitalized.
dump
Thedump filter serializes a JavaScript object into a JSON string.
Syntax
object_value(any): The input object to be serialized.
join
Thejoin filter joins elements of an array into a single string, separated by a specified separator.
Syntax
array_value(any[]): The input array.separator(string, optional): The string to separate the array elements. Defaults to", ".
lower
Thelower filter converts a string to lowercase letters.
Syntax
string_value(string): The input string to be converted to lowercase.
replace
Thereplace filter replaces all occurrences of a specified substring with a new substring.
Syntax
string_value(string): The input string.search(string): The substring to search for.replace(string): The substring to replace with.
round
Theround filter rounds a number to a specified number of decimal places.
Syntax
number_value(number): The input number to be rounded.decimals(number, optional): The number of decimal places to round to. Defaults to0.
truncate
Thetruncate filter truncates a string to a specified length and appends an ellipsis (...) if necessary.
Syntax
string_value(string): The input string to be truncated.length(number): The maximum length of the output string.
upper
Theupper filter converts a string to uppercase letters.
Syntax
string_value(string): The input string to be converted to uppercase.
urlencode
Theurlencode filter encodes a string to be safe for use in URLs.
Syntax
string_value(string): The input string to be URL-encoded.