diff --git a/src/Validator/BindForm.php b/src/Validator/BindForm.php new file mode 100644 index 0000000..0183192 --- /dev/null +++ b/src/Validator/BindForm.php @@ -0,0 +1,41 @@ +getReflectionClass($this->formValidate); + $model = $reflect->newInstanceWithoutConstructor(); + foreach ($reflect->getProperties() as $property) { + foreach ($property->getAttributes() as $attribute) { + $rule = $attribute->newInstance(); + if ($rule instanceof ValidatorInterface) { + $validator->addRule($property->getName(), $model, $rule); + } + } + } + return $validator; + } + +}