4.1.1 Simple Rules

As the name suggests, this is the simplest way to define a validation rule. The general syntax for defining rules this way is:

var $validate = array('fieldName' => 'ruleName');
  1. var $validate = array('fieldName' => 'ruleName');

Where, ‘fieldName’ is the name of the field the rule is defined for, and ‘ruleName’ is a pre-defined rule name (covered in the next section).