For freemarker, a Java templating language.
|
boolean
|
Converts string to boolean (true, false)
|
|
cap_first
|
Capitalizes first word of string
|
|
capitalize
|
Capitalizes every word in string properly
|
|
chop_linebreak
|
Removes line-break from end of string
|
|
contains (substring)
|
Checks if string contains substring
|
|
date, time, datetime
|
Converts string to date/time/datetime based on *_format
|
|
ends_with (substring)
|
Checks if string ends with substring
|
|
ensure_ends_with (substring)
|
Returns string with substring appended if not already there
|
|
ensure_starts_with (substring)
|
Same as ensure_ends_with, but prepended
|
|
groups[x]
|
Returns the returns the regex group from the matches method if it exists
|
|
html
|
Returns the string with html characters parsed to ampersand codes
|
|
index_of (substring)
|
Returns the index of the requested substring in string
|
|
j_string
|
Escapes the string for Java String Literals
|
|
js_string
|
Escapes the string for Javascript String Literals
|
|
json_string
|
Escapes the string for JSON String Literals
|
|
keep_after (substring, flags="")
|
Returns all text after substring, not including substring
|
|
keep_before (substring, flags="")
|
Returns all text before substring, not including substring
|
|
last_index_of (substring)
|
Returns the index of the last occurance of substring
|
|
left_pad (x, seperator=" ")
|
Returns the string with [seperator] prepended up to a maximum length
|
|
length
|
The number of characters in the string
|
|
lower_case
|
Returns string in all lower case
|
|
matches
|
Regex Pattern checker
|
|
number
|
The string as a number
|
|
replace (substring, replace)
|
Returns all occurances of substring with replace
|
|
right_pad (x, seperator=" ")
|
Same as left_pad, but appended instead
|
|
remove_beginning (substring)
|
Returns string with substring removed from the beginning
|
|
remove_ending
|
Same as remove_beginning, except fromt he ending
|
|
rtf
|
Rich Text Format
|
|
split (substring)
|
Split a string at each substring
|
|
starts_with
|
Same as ends_with, but for string beginning
|
|
string
|
Takes a multi-value variable and returns just the string parts
|
|
substring
|
Depricated, use string[x..y]
|
|
trim
|
Removes leading and trailing whitespace
|
|
uncap_first
|
The opposite of cap_first
|
|
upper_case
|
Opposite of lower_case
|
|
url
|
URL Character escaping
|
|
url_path
|
Same as url but doesn't escape slashes
|
|
word_list
|
Returns a sequence of all words in a string
|
|
xhtml
|
Same as html, but for xhtml escaping
|
|
xml
|
Same as hxtml, but difference code for '
|
|
abs
|
Absolute Value
|
|
c
|
Num to String without formatting
|
|
is_infinite
|
True if number is floating point infinite
|
|
is_nan
|
True if number is NaN
|
|
round, floor, ceiling
|
Rounds to closest, lowest, and highest, respectively
|
|
string.format
|
Num to String with optional formatting (format can be number, currency, percent, or computer)
|
|
date
|
Returns date only from a datetime value (Only use if variable is problematic)
|
|
time
|
Returns time only from a datetime value (Only use if variable is problematic)
|
|
datetime
|
Returns date and time from a datetime value (Only use if variable is problematic)
|
|
(date/time/datetime)_if_unknown
|
Marks a date-like value with specified missing subtype
|
|
iso_...
|
Converts date-like value to specified iso format. Depricated in favour of _format settings
|
|
string.format
|
Converts date-like object to string. See freemarker manual for formats
|
|
c
|
Boolean to String for computer languages
|
|
string("string1", "string2")
|
Boolean to String with human-readable flags. Provided as "string1" for true and "string2" for false
|
|
chunk(x, filler=null)
|
Splits sequence into multiple sequences of size x. Last chunk
|
|
first
|
Returns the first element of the sequence
|
|
join(seperator)
|
Concatonates sequence elements with seperator in between
|
|
last
|
Returns the last element in the sequence
|
|
reverse
|
Returns the sequence in reverse order
|
|
seq_contains(needle)
|
Returns true if the squence contains needle
|
|
seq_index_of(needle)
|
Same as contains, but returns the index of the first element
|
|
seq_last_index_of(needle)
|
|
|
size
|
|
|
sort
|
|
|
sort_by
|
|
|
ancestors(name)
|
Returns a sequence of nodes ancestors. Starts with immediate parent and ends with root. Should be filtered with name
|
|
children
|
Returns a sequence of all child nodes
|
|
node_name
|
Returns the node name (directive invoked when node is "visited")
|
|
node_namespace
|
Returns namespace string of node
|
|
node_type
|
Returns a string with the node type
|
|
parent
|
Returns the immediate parent node
|
|
root
|
Returns the root node
|
|
i
|
Case Insensitive (eg. x==X)
|
|
f
|
First Only (Only apply to first occurance)
|
|
r
|
Substring is regex
|
|
m
|
Multi-line mode for regex
|
|
s
|
Enables dot-all mode for regex (. is wildcard)
|
|
c
|
Allows whitespace and comments in regex
|
|
Keys
|
A sequence with all the hash keys
|
|
Values
|
A sequence with all the hash values
|
|
byte, double, float, int, long, short
|
Converts numbers to other types of numbers
|
|
eval
|
Evaluate a string as an FTL expression
|
|
has_content
|
Returns true if variable exists and isn't empty, false otherwise
|
|
interpret
|
Returns the value of a string interpreted as FTL code. Sort of like a function
|
|
is_...[type]
|
Checks if variable is of type [type]. See docs for full list
|
|
namespace
|
Returns macro or function namespace, if any
|
|
new
|
Creates a variable of type class. Usage is var = "FQDN"?new(options)
|
|
number_to_[date/time/datetime]
|
Converts a number to date/time/datetime, using the number of seconds since epoch
|
|
assign name=value [in namespacehash]
|
Creates a variable called name
|
|
attempt/recover
|
try/catch
|
|
compress
|
Removes all but one newline character between lines
|
|
escape x as x?[escape type]
|
<pre> tag for freemarker code
|
|
flush
|
Forces generated output to be written. 99% of the time is not neccessary
|
|
ftl
|
Tells programs that file is an ftl file. Takes optional parameters found on the docs page
|
|
function/return
|
Similar to a macro, except returns a specific value as denoted by return
|
|
global
|
Makes a global variable. Variable will be exposed as if at data-model level
|
|
if/elseif/else
|
Creates an if/elseif/else block
|
|
import path as hash
|
Imports the library at location path for use in the current ftl file
|
|
include path
|
Includes the file at location path for use in current document
|
|
list sequence as item
|
foreach loop
|
|
local
|
Like assign, but creates local variables within macros or functions
|
|
macro/nested/return
|
Macro outputs a block of user-defined code which wraps nested (optionally, otherwise just outputs the code). return works as a break
|
|
noparse
|
<pre> tag for ftl
|
|
nt
|
No trim. Disables whitespace stripping
|
|
setting name=value
|
Modifies parse settings. View full list in the docs page
|
|
stop [reason]
|
Per ftl docs: an emergency brake. Don't use in normal situations. Returns reason if set
|
|
switch/case/default/break
|
A regular switch block
|
|
t, lt, rt
|
Trim, left trim, right trim. Ignores whitespace based on tag position used
|
|
visit/recurse/fallback
|
Used for parsing trees, usually XML. See the ftl docs for full info
|
No comments yet.
Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.