2013-01-15 36 views
0

我試圖把模型分成Zend註冊從主應用程序引導文件中找到的模型:Zend的,不能從引導

public function _initRegistry() 
{ 
    $this->bootstrap('db'); 

    $processmanager = new Systems_Model_Process(); 
    Zend_Registry::set('processmanager', $processmanager); 
} 

出於某種原因,我遇到了以下錯誤:

Warning: include_once(Systems/Model/Process.php) [function.include-once]: failed to open stream: No such file or directory in /home/planetxg/public_html/dash/library/Zend/Loader.php on line 146 

Warning: include_once() [function.include]: Failed opening 'Systems/Model/Process.php' for inclusion (include_path='/home/planetxg/public_html/dash/application/../library:/home/planetxg/public_html/dash/library:.:/usr/lib/php:/usr/local/lib/php') in /home/planetxg/public_html/dash/library/Zend/Loader.php on line 146 

Fatal error: Class 'Systems_Model_Process' not found in /home/planetxg/public_html/dash/application/Bootstrap.php on line 20 

有問題的模式是在以下位置:

application/modules/Systems/models/Process.php 

有什麼簡單的,我錯唱歌或不在這裏設置?在控制器中正常調用模型時,我應該添加一切工作正常。

這裏是我的主INI塊,如果有幫助:

phpSettings.display_startup_errors = 1 
phpSettings.display_errors = 1 
includePaths.library = APPLICATION_PATH "/../library" 
bootstrap.path = APPLICATION_PATH "/Bootstrap.php" 
bootstrap.class = "Bootstrap" 
appnamespace = "Application" 
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers" 
resources.frontController.params.displayExceptions = 0 
resources.frontController.actionHelperPaths.Utilities = APPLICATION_PATH "/controllers/Helpers" 
resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts/" 
resources.frontController.moduleDirectory = APPLICATION_PATH "/modules" 
resources.modules[] = 
autoloaderNamespaces[] = "CreativeLaunch_" 
autoloaderNamespaces[] = "Systems_" 
+0

您是否指定了模塊目錄? – Fender

+0

你的意思是在application.ini中?如果是這樣,是的 - 我會在這裏添加 – BenOfTheNorth

+0

看看[這裏](http://stackoverflow.com/questions/2542892/zend-framework-modules-cant-find-load-models) – bitWorking

回答

1

您需要在application/modules/systems/Bootstrap.php模塊引導類延伸Zend_Application_Module_Bootstrap。這將設置模塊自動加載。你的模塊文件夾也應該是小寫 - application/modules/systems

模塊資源需要在主引導文件的_initRegistry方法之前已經運行,因此該方法的第一行更改爲:

$this->bootstrap(array('db', 'modules')); 

其他的一切看起來不錯。

+0

我已經有一個模塊引導程序,只是一個佔位符,只不過是你所描述的類聲明和擴展。我添加了模塊調用引導鏈接,但沒有改變任何東西:/ - 試圖改變的情況,但nada – BenOfTheNorth

+0

其實,我只是注意到數組環繞引導參數,補充說,它現在工作的一種享受, 謝謝! – BenOfTheNorth