コード例 #1
0
 /**
  * Executes the validation
  *
  * @param Phalcon\Validation $validator
  * @param string             $attribute
  *
  * @return boolean
  */
 public function validate($validator, $attribute)
 {
     // If the attribute is name we must stop the chain
     if ($attribute == 'name') {
         $validator->setOption('cancelOnFail', true);
     }
     //...
 }