knyga / evalidator
0.0.3
2020-12-29 00:03 UTC
Requires
- php: >=7.4
- yiisoft/yii2: >=2.0.5
Requires (Dev)
This package is not auto-updated.
Last update: 2025-01-07 18:32:55 UTC
README
See tests.
$m = new EValidator([ ['email', 'email'] ]); // $m->setData([ // 'email' => 'something' // ]); $object = new \StdClass; $object->email = 'something'; $m->setData($object); /** * false */ var_dump($m->validate()); /** * array(1) { * ["email"]=> * array(1) { * [0]=> * string(35) "Email is not a valid email address." * } * } */ var_dump($m->getErrors()); $m->setData([ 'email' => 'something@gmail.com' ]); /** * true */ var_dump($m->validate());