Validate character delimited email strings and return all errors.
This extension has been tested with Yii Framework 1.1.5
Place the extension in your protected\extensions directory and add it to your model like the following:
/** * ShareReportForm class. */ class ShareReportForm extends CFormModel { public $emails; /** * Declares the validation rules. */ public function rules() { return array( array('emails', 'required'), array('emails', 'ext.MultiEmailValidator', 'delimiter'=>',', 'min'=>1, 'max'=>5), ); } /** * Declares customized attribute labels. * If not declared here, an attribute would have a label that is * the same as its name with the first letter in upper case. */ public function attributeLabels() { return array( 'emails'=>'Email To', ); } }
Be the first person to leave a comment
Please login to leave your comment.