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.
encodebooleannotrueWhen set to true, encodes tag content, attribute values, and URLs so that Cross Site Scripting (XSS) attacks can be prevented. Set to attributes to only encode attribute values and not tag content.