I have a Zend Framework application structure as below:
/application
/library
/Zend
/Core
/Filter
/MyFilter.php
/Validator
/MyValidator.php
I would like to put custom filters and validators in their respective folders and have them loaded automatically when used. However, I cannot figure out how to best accomplish this.
I need the solution to work with Zend_Filter_Input in this fashion:
$filters = array(
'month' => 'Digits',
'account' => 'StringTrim',
'other' => 'MyFilter'
);
$validators = array(
'account' => 'Alpha',
'other' => 'MyValidator'
);
$inputFilter = new Zend_Filter_Input($filters, $validators);
What I already know:
- Core_Filter_MyFilter implements Zend_Filter_Interface
- Obviously, the filters and validators are already in my include path.