dpka7974
2010-09-27 06:38
浏览 9
已采纳

是否可以使用一个语句加载所有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?

图片转代码服务由CSDN问答提供 功能建议

我想用一个语句加载几个表单元素,如 Zend_Form_Element_Text 。 有没有办法用 * 外卡做到这一点?

  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • dongyouzhui1969 2010-09-27 07:20
    已采纳

    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

    已采纳该答案
    打赏 评论

相关推荐 更多相似问题