validate email without a model


What would be the best way to run Yii email validator outside of the model?

Ex.: user submits a list of emails (separated by commas), I explode them into array and need to run email validation for each item.

Should I create a dummy model or is there any better solution?

Thank you.

(not tested).

$validator = new CEmailValidator;



    // valid


    // invalid


CEmailValidator does not have a method named "validateValue".

I just tested for myself and it works

		$validator = new CEmailValidator;


			echo "validated";

Try validateAttribute() method.

Validate attribute works with models and does not return a boolean value.

read the source

CEmailValidator::validateValue($value) is the method to use.

validateValue() is available in SVN but not in a official relase so far, isnt it?

I usually use validateValue() wich does what needs to be done