Difference between #6 and #7 of
Create your own Validation Rule

Revision #7 has been created by Boaz on May 14, 2012, 12:41:35 PM with the memo:

actually, not :) (undoing my last update), as its not in line with parent abstract declaration for this method (which is a bug IMHO, I'll report to the Yii team)
« previous (#6) next (#8) »


Title unchanged

Create your own Validation Rule

Category unchanged


Yii version unchanged

Tags unchanged

validator, validation rules, model validation, create validator

Content changed

* Validates the attribute of the object.
* If there is any error, the error message is added to the object.
* @param CModel $object the object being validated
* @param string $attribute the attribute being validated
protected function validateAttribute(
CModel $object,$attribute)
// check the strength parameter used in the validation rule of our model
if ($this->strength == 'weak')
$pattern = $this->weak_pattern;
elseif ($this->strength == 'strong')
58 0
Viewed: 211 033 times
Version: 1.1
Category: How-tos
Written by: nickcv
Last updated by: Gismo
Created on: Mar 31, 2011
Last updated: 5 years ago
Update Article


View all history