Built-in Function
Built-ins are like methods that are added to the objects by FreeMarker
. To prevent name clashes with actual methods and other sub-variables, instead of dot (.), you separate them from the parent object with question mark (?).
Some examples:
${testString?upper_case} |
Assuming that testString stores the string “Tom & Jerry”, and testSequnce stores the strings “foo”, “bar” and “baz”, the output will be:
TOM & JERRY |
html
(deprecated): This built-in is deprecated by the auto-escaping mechanism introduced in 2.3.24.
Other examples:
path?ensure_starts_with('/') |
Ref links: builtin methods