Zend Framework Modules can't find/load Models

后端 未结 4 1634
北恋
北恋 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 05:48

    1-feel free to delete this cuz you don't need it any more :

    resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
    

    and place this code inside you Bootstrap.php file [application bootstrap ] not the module bootstrap

    public function _initAutoload()
    {
    $autoloader = new Zend_Application_Module_Autoloader(array(
    'namespace' => '' , 
    'basePath' => dirname(__FILE__) . '/modules/'));
    return $autoloader;
    }
    

    getting back to config you need also to add

       resources.modules[] = ""    
       resources.frontController.defaultModule = "admin" 
    

    here is my complete config file :

    phpSettings.display_startup_errors = 0
    phpSettings.display_errors = 0
    includePaths.library = APPLICATION_PATH "/../library"
    bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
    bootstrap.class = "Bootstrap"
    appnamespace = "Application"
    resources.frontController.defaultModule = "news"
    resources.frontController.prefixDefaultModule = 1
    resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
    resources.modules[] = ""
    ;resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
    resources.frontController.params.displayExceptions = 1
    resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts/"
    autoloaderNamespaces[] = "xxxxxx"
    
    resources.db.adapter = "Mysqli"
    resources.db.isdefaulttableadapter = true
    resources.db.params.host = "localhost"
    resources.db.params.dbname = "xxxxx"
    resources.db.params.username = "root"
    resources.db.params.password = "root"
    resources.db.params.charset = "utf8"
    

    hopefully i didn't miss any thing

提交回复
热议问题