views:

25

answers:

1

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?

+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
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
Indeed, this is the better way to load classes
David Caunt