base\Model getValidators()

getValidators() public method

Returns all the validators declared in rules().

This method differs from getActiveValidators() in that the latter only returns the validators applicable to the current $scenario.

Because this method returns an ArrayObject object, you may manipulate it by inserting or removing validators (useful in model behaviors). For example,

$model->validators[] = $newValidator;
public ArrayObject|yii\validators\Validator[] getValidators ( )
return ArrayObject|yii\validators\Validator[]

All the validators declared in the model.

doc_Yii
2016-10-30 16:51:51
Comments
Leave a Comment

Please login to continue.