Return to v2.1 docs

errorMessagesFor()


View Helpers Error Functions string controller


Builds and returns a list (ul tag with a default class of error-messages) containing all the error messages for all the properties of the object. Returns an empty string if no errors exist.

Name Type Required Default Description
objectName string Yes The variable name of the object to display error messages for.
class string No error-messages CSS class to set on the ul element.
showDuplicates boolean No true Whether or not to show duplicate error messages.
encode boolean No true Use 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.

Related Functions

Error Functions