FormMessage
trait FormMessage mixin ViewableData (View source)
Form component which contains a castable message
Properties
protected | string | $message | ||
protected | string | $messageType | ||
protected | string | $messageCast | Casting for message |
Methods
Sets the error message to be displayed on the form field.
Get casting helper for message cast, or null if not known
Details
string
getMessage()
Returns the field message, used by form validation.
Use setError() to set this property.
string
getMessageType()
Returns the field message type.
Arbitrary value which is mostly used for CSS classes in the rendered HTML, e.g "required".
Use setError() to set this property.
string
getMessageCast()
Casting type for this message. Will be 'text' or 'html'
$this
setMessage(string $message, string $messageType = ValidationResult::TYPE_ERROR, string $messageCast = ValidationResult::CAST_TEXT)
Sets the error message to be displayed on the form field.
Allows HTML content, so remember to use Convert::raw2xml().
protected string
getMessageCastingHelper()
Get casting helper for message cast, or null if not known
array|null
getSchemaMessage()
Get form schema encoded message