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

  1. Requirements
  2. Usage
  3. Resources

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',
    );
  }
}

Resources

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: 7 years ago

Downloads

show all

Related Extensions