是否可以使用一个语句加载所有Zend_Form_Element_ *?
问题描述:
I'd like to load several form elements like Zend_Form_Element_Text
with one statement. Is there a way to do this with a *
wild card?
我想用一个语句加载几个表单元素,如 Zend_Form_Element_Text code>。 有没有办法用
* code>外卡做到这一点? p>
div>
答
Instead of trying to load them like that, why don't you register Zend's autoloader?
After registering the Zend Framework autoload callback, you can reference classes from Zend Framework without having to load them explicitly. The autoload() method uses Zend_Loader::loadClass() automatically when you reference a class.
All you need to put in your code is:
Zend_Loader::registerAutoload();
Quote is from http://framework.zend.com/manual/en/zend.loader.load.html