开发者

Module Bootstrap not working

开发者 https://www.devze.com 2023-02-09 06:34 出处:网络
I have a Person Module and here is my bootstrap: application/modules/person/Bootstrap.php class Person_Bootstrap extends Zend_Application_Bootstrap_Bootstrap {

I have a Person Module and here is my bootstrap:

application/modules/person/Bootstrap.php

class Person_Bootstrap extends Zend_Application_Bootstrap_Bootstrap {
    protected function _initAutoload() {
        $personLoader = new Zend_Loader_Autoloader_Resource( array (
            'basePath'  =>  APPLICATION_PATH . '/modules/person',
            'namespace' =>  'Person',
            'resourceTypes' =>  array (
                                        'form'  =>  array ( 'path'  =>  'forms/', 'namespace' =>  'Form_' ),
                                        'model' =>  array ( 'path'  =>  'models/', 'namespace' =>  'Model_' )
                      开发者_开发问答                );
        ));
        return $personLoader ;
    }
} // end class

But whenever I go to any controller/action of this module, it is not considering this bootstrap. Therefore I am unable to access forms in this module like:

class Person_Form_MyForm extends Zend_Form {

   // elements
}


Zend_Application_Bootstrap_Bootstrap is for your application Bootstrap, which goes into application/Bootstrap.php

When creating a module bootstrap, you should extend Zend_Application_Module_Bootstrap class.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号