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?
views:
25answers:
1
+2
A:
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
Maerlyn
2010-09-27 07:20:41
Thanks, just a note, I got a notice that `registerAutoload` is deprecated as of 1.8.0 so I used `Zend_Loader_Autoloader` as per this blog http://akrabat.com/zend-framework/zend_loaders-autoloader_deprecated-in-zend-framework-18/
Berming
2010-09-27 07:57:28
Indeed, this is the better way to load classes
David Caunt
2010-09-27 10:10:32