Zend Framework Modules can't find/load Models

后端 未结 4 1629
北恋
北恋 2021-02-11 05:12

For some frustrating reason, I configured some Modules, which seemed to work fine, However I cannot load a Modules Models. If I move the Models to the Default they load, but I j

4条回答
  •  孤城傲影
    2021-02-11 06:11

    The correct class name would be Books_Model_Books, but the filename of that class would need to be Books.php (note the capital 'B').

    You shouldn't have a bootstrap in the modules directory, but you probably do want a bootstrap for each module directory, so you'd need a class:

    class Books_Bootstrap extends Zend_Application_Module_Bootstrap
    {
    
    }
    

    at: application/modules/books/Bootstrap.php (again note the capital 'B').

    Check the section on the module resource autloader at http://framework.zend.com/manual/en/zend.loader.autoloader-resource.html for more info.

提交回复
热议问题