Skip to content

Auramel/yii2-validation-rules

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

yii2-validation-rules

for yii2

It's a wrapper on a current rules in \yii\base\Model. See discussion: https://github.com/yiisoft/yii2/issues/16027

TODO: add tests.

Use ValidationRule.

public function rules()
{
    return [
        ValidationRule::attributes(['foo', 'bar'])->required()->build(),
        ValidationRule::atribute('foo')->string()->min(6)->on(self::SCENARIO_DEFAULT)->build()
    ];
}

About

for yii2

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages