get()

Usage

get(entity, propertyKey)

Description
Returns the value for the given property key from the given entity. This method will print an error message if the first parameter is null / not accessible. See get_or_null() for a more tolerant get method.

Please note that the result value of the get() method can differ from the result value of property access using the dot notation (get(this, 'name') vs this.name) for certain property types (e.g. date properties), because get() converts the property value to its output representation. That means that a Date object will be formatted into a string when fetched via get(this, 'date'), whereas this.date will return an actual date object.

Example

${get(page, 'name')}

results in

my-page-name
About this article
Last change 2019-08-15
Topics FrontendFunctionsStructr 2.0