config()method of your model. This keeps everything nice and tidy because another developer can check
config()to get a quick idea on how your model behaves.
passwordfields must be provided, and they can't be blank.
lastNamecan each be up to 50 characters long.
agecan only be an integer.
passwordmust be provided twice, the second time via a field called
whenargument accepts 3 possible values.
unlessprovide even more flexibility when the
whenargument isn't specific enough for your validation's needs.
conditionspecifies when the validation should be run.
unlessspecifies when the validation should not be run.
validateEmailFormat, which in this case would verify that the value set for
this.emailis in the proper format. If not, then the method sets an error message for that field using the addError()function.
IsValid()is a function build into your CFML engine.
newUserbased on the
usermodel and the form inputs (via the
<cfif>test. If the save succeeds, the save() method will return
true, and the contents of the
<cfif>will be executed. But if any of the validations set up in the model fail, the save() method returns
false, and the
<cfelse>renders the original form input page using the renderView()function. When this happens, the view will use the
newUserobject defined in our save() method. If a redirectTo() were used instead, the validation information loaded in our save() method would be lost.
[property]to the message string. Wheels will automatically separate words based on your camelCasing of the variable names.
config()method of our model: