Revision #6 was created by Boaz on May 14, 2012, 12:37:38 PM.
adding type declaration (CModel) to the example validateAttribute() method.
Content
[...]
* 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')