add (attribute, messages) deprecated
Adds error messages to a given attribute and sends becameInvalid
event to the record.
Example:
1 2 3 | if (!user.get( 'username' ) { user.get( 'errors' ).add( 'username' , 'This field is required' ); } |
Parameters:
-
attribute
String
-
messages
(Array|String)
Please login to continue.