Hey there,

I'm currently taking my first steps with Zend_Form. Previously, I've used Zend_Filter_Input for all my validation needs.

I have a nice validator chain generator for ActiveRecord-like objects, so that I don't need to write all validation rules by hand. The resulting objects are not only used to validate forms, but also incoming data from other data sources.

I had always hoped I could reuse my existing Zend_Filter_Input objects once I switch to Zend_Form for handling web forms, but I can't seem to find any information on how to do this - is it at possible?

Something along the lines of:

$validatorChain = $dataObject->getValidators();
/* @var $validatorChain Zend_Filter_Input */
$form = new Zend_Form();
$form->setValidators($validatorChain);

Or will I have to recreate all filter rules whenever I want to use Zend_Form? Having two different mechanisms for that would not be an optimal solution (to put it nicely :-)).

CU
 Markus

Reply via email to