cascaded-validator Applies any validator to an attributes, but only if another attribute matches certain preconditions

This extension is a simple Validator. It can be used to validate a model attribute with any other built in or custom validator. It is only evaluated if another attribute fulfills certain preconditions (checked via any built in or custom validator).

Resources

Documentation

Requirements
  • Yii 1.1.2 or above (might work with early version, too)
Installation
  • Extract the release file under protected/validators
  • Add 'application.validators.*' to the 'import' array in the global config
Usage

See the following code example: ~~~ [php model file]

public function rules() {

return array(
	array('userEmail', 'CascadedValidator', 'parentRule' => array('receiveNewsletter', 'match', 'pattern' => '/yes, please/'), 'childRule' => array('email'), 'negateParentCheck' => false),
);

}



##Change Log

###June 25, 2010
* Initial release.

1 0
1
412
Yii Version: 1.1
License: BSD-2-Clause
Category: Validation
    Developed by: musterknabe musterknabe
    Created: Jun 25, 2010
    Updated: 16 years ago

    Downloads

    show all