9
我有如下Zend框架应用程序结构:自定义过滤器/校验Zend框架
/application
/library
/Zend
/Core
/Filter
/MyFilter.php
/Validator
/MyValidator.php
我想提出的自定义过滤器和校验在各自的文件夹,并有使用它们时自动加载。但是,我无法弄清楚如何最好地完成这一点。
我需要的解决方案以这种方式使用的Zend_Filter_Input工作:
$filters = array(
'month' => 'Digits',
'account' => 'StringTrim',
'other' => 'MyFilter'
);
$validators = array(
'account' => 'Alpha',
'other' => 'MyValidator'
);
$inputFilter = new Zend_Filter_Input($filters, $validators);
我已经知道:
- Core_Filter_MyFilter实现Zend_Filter_Interface,
- 显然,过滤器和校验已经在我包括路径。
非常好!我花了几个小时阅读文档,但我一定错过了这个被提及的事情。谢谢! – leek 2008-10-08 23:58:26