multi-email-validator Validate character delimited email strings and return all errors.

  1. Requirements
  2. Usage

Validate character delimited email strings and return all errors.

Requirements

This extension has been tested with Yii Framework 1.1.5

Usage

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',
    );
  }
}
3 0
7 followers
1 041 downloads
Yii Version: 1.1.*
License: BSD-2-Clause
Category: Validation
Developed by: DarkNSF
Created on: Dec 22, 2010
Last updated: 4 years ago

Related Extensions