Writing Zend\Validator Rules in config files

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Writing Zend\Validator Rules in config files

Philip G
Are there any examples online of configs used by Zend\Validator to setup up
validation rules?

Back in ZF1.x, you could write .ini or .php files for validator rules. I'm
trying to locate such examples for ZF2.

I'm in an instance where I need to create a secondary config file for
Validation rules based on a third-source API return. Then use that config
file by a secondary process to validate a file (imports).

But I can't seem to find any examples of .ini or .php Zend\Validator config
file for rules.

Can anybody point me in the right direction?

Philip
Reply | Threaded
Open this post in threaded view
|

Re: Writing Zend\Validator Rules in config files

Ralf Eggert
Hi Philip,

you can note your validation (and filter) rules in an file in the array
format and pass it to the Zend\InputFilter\Factory::createInputFilter()
method.

Here is an example (fourth listing on this page)

http://framework.zend.com/manual/current/en/modules/zend.input-filter.intro.html

Thanks and best regards,

Ralf

--
List: [hidden email]
Info: http://framework.zend.com/archives
Unsubscribe: [hidden email]