Global

Methods

capitalize_filter()

Transforms the first Character of a string to uppercase.
Source:
See:
  • String.prototype.capitalize

dateFormat_filter(format)

Returns a formatted string representation of a Date. Simply wraps javascripts Date.format-method.
Parameters:
Name Type Description
format
Source:
See:
  • Date.prototype.format

encode(text, encodeNewLineopt) → {string}

Encodes a string for HTML output and inserts linebreak tags. Performs the following string manipulations: All line breaks (i.e. line feeds) are replaced with
tags. All special characters are being replaced with their equivalent HTML entity. Existing markup tags are being encoded.
Parameters:
Name Type Attributes Default Description
text string The string to encode for HTML output.
encodeNewLine boolean <optional>
true If or if not to encode line breaks (i.e. line feeds).
Source:
Returns:
The encoded string.
Type
string

encodeForm(text) → {string}

Encodes a string for HTML output, leaving linebreaks untouched. Performs the following string manipulations: Unlike encode, leaves linebreaks untouched. This is what you usually want to do for encoding form content (esp. with text input values). All special characters (i.e. non ASCII) are being replaced with their equivalent HTML entity. Existing markup tags are being encoded.
Parameters:
Name Type Description
text string The string to format for HTML output.
Source:
Returns:
The string formatted for HTML output.
Type
string

encodeXml(text) → {string}

Encodes a string for XML output. Performs the following string manipulations: All special characters are being replaced with their equivalent HTML entity. Existing tags, single and double quotes, as well as ampersands are being encoded. Some invalid XML characters below '0x20' are removed
Parameters:
Name Type Description
text string The string to encode for XML output.
Source:
Returns:
The string encoded for XML output.
Type
string

escapeHtml_filter()

Escapes the characters in a String using HTML entities.
Source:
See:

escapeJavaScript_filter()

Escapes a string so it may be used in JavaScript String definitions.
Source:

escapeUrl_filter(charset)

Escapes the characters in a String to be suitable to use as an HTTP parameter value.
Parameters:
Name Type Description
charset Optional String. The name of a supported character encoding.
Source:
See:

escapeXml_filter()

Escapes the characters in a String using XML entities. Currently simply wraps Helma's encodeXml-method.
Source:
See:
  • global.encodeXml

gettext()

For convenience reasons the public methods and macros are put into global scope too
Source:

isArray(val)

Returns true if the value passed as argument is an array.
Parameters:
Name Type Description
val Object The value to test
Source:
Returns:
True if the value is an array, false otherwise

isBoolean(val)

Returns true if the value passed as argument is either a boolean literal or an instance of Boolean.
Parameters:
Name Type Description
val Object The value to test
Source:
Returns:
True if the value is a boolean, false otherwise

isDate(val)

Returns true if the value passed as argument is either a Javascript date or an instance of java.util.Date.
Parameters:
Name Type Description
val Object The value to test
Source:
Returns:
True if the value is a date, false otherwise

isFunction(val)

Returns true if the value passed as argument is a function.
Parameters:
Name Type Description
val Object The value to test
Source:
Returns:
True if the argument is a function, false otherwise

isNull(val)

Returns true if the value passed as argument is null.
Parameters:
Name Type Description
val Object The value to test
Source:
Returns:
True if the value is null, false otherwise

isNumber(val)

Returns true if the value passed as argument is either a number, an instance of Number or of java.lang.Number.
Parameters:
Name Type Description
val Object The value to test
Source:
Returns:
True if the value is a number, false otherwise

isObject(val)

Returns true if the value passed as argument is either a Javascript object or an instance of java.lang.Object.
Parameters:
Name Type Description
val Object The value to test
Source:
Returns:
True if the value is an object, false otherwise

isString(val)

Returns true if the value passed as argument is either a string literal, an instance of String or of java.lang.String.
Parameters:
Name Type Description
val Object The value to test
Source:
Returns:
True if the value is a string, false otherwise

isUndefined(val)

Returns true if the value passed as argument is undefined.
Parameters:
Name Type Description
val Object The value to test
Source:
Returns:
True if the value is undefined, false otherwise

linebreakToHtml_filter()

Replaces linebreaks with HTML linebreaks.
Source:

lowercase_filter()

Transforms a string to lowercase.
Source:
See:
  • String.prototype.toLowerCase

now_macro(Object)

renders the current datetime
Parameters:
Name Type Description
Object containing a formatting string as format property
Source:

property_macro(Object)

write out a property contained in app.properties
Parameters:
Name Type Description
Object containing the name of the property
Source:

replace_filter(old, new)

Performs a string replacement.
Parameters:
Name Type Description
old
new
Source:

skin_macro()

renders a global skin
Source:

stripTags(markup) → {string}

Removes any markup tags contained in the passed string, and returns the modified string.
Parameters:
Name Type Description
markup string The text that is to be stripped of tags.
Source:
Returns:
The text with the tags stripped out.
Type
string

stripTags_filter()

Removes all tags from a String. Currently simply wraps Helma's stripTags-method.
Source:
See:
  • global.stripTags

substring_filter(from, to)

Returns a substring. Simply wraps the javascript method 'substring'.
Parameters:
Name Type Description
from
to
Source:
See:
  • String.prototype.substring

titleize_filter()

Transforms the first Character of each word in a string to uppercase.
Source:
See:
  • String.prototype.titleize

trim_filter()

Removes leading and trailing whitespaces.
Source:
See:
  • String.prototype.trim

truncate_filter(limit, clipping)

Cuts a String at a certain position, and optionally appends a suffix, if truncation has occurred.
Parameters:
Name Type Description
limit Maximum length
clipping Appended String, default is the empty String
Source:
See:
  • String.prototype.head

uppercase_filter()

Transforms a string to uppercase.
Source:
See:
  • String.prototype.toUpperCase

write_macro(Object)

wrapper to output a string from within a skin just to be able to use different encodings
Parameters:
Name Type Description
Object containing the string as text property
Source: