I want to validate the phone number,
use the following code in rules
…
array('phone','match','/^[ + ]{1}[1-9]\d{0,3}[.]{1}[\d\s]+$/'),
…
error comes up as following:
CException
Description
Property "CRegularExpressionValidator.0" is not defined.
Source File
E:\eclipse\workspace\PDTproject\framework\validators\CValidator.php(126)
00114: }
00115: $validator->params=$params;
00116: }
00117: else
00118: {
00119: $params['attributes']=$attributes;
00120: if(isset($builtInValidators[$name]))
00121: $className=Yii::import($builtInValidators[$name],true);
00122: else
00123: $className=Yii::import($name,true);
00124: $validator=new $className;
00125: foreach($params as $name=>$value)
00126: $validator->$name=$value;
00127: }
00128: return $validator;
00129: }
00130:
00131: /**
00132: * Validates the specified object.
00133: * @param array the list of attributes to be validated. Defaults to null,
00134: * meaning every attribute listed in {@link attributes} will be validated.
00135: * @param CModel the data object being validated
00136: */
00137: public function validate($object,$attributes=null)
00138: {