Skip to content

View Helpers

errorMessageOn()

errorMessageOn() — returns string

Available in: controller Category: Error Functions

Returns the error message, if one exists, on the object’s property. If multiple error messages exist, the first one is returned.

NameTypeRequiredDefaultDescription
objectNamestringyesThe variable name of the object to display the error message for.
propertystringyesThe name of the property to display the error message for.
prependTextstringnoString to prepend to the error message.
appendTextstringnoString to append to the error message.
wrapperElementstringnospanHTML element to wrap the error message in.
classstringnoerror-messageCSS class to set on the wrapper element.
encodebooleannotrueUse this argument to decide whether the output of the function should be encoded in order to prevent Cross Site Scripting (XSS) attacks. Set it to true to encode all relevant output for the specific HTML element in question (e.g. tag content, attribute values, and URLs). For HTML elements that have both tag content and attribute values you can set this argument to attributes to only encode attribute values and not tag content.