2010-06-08 46 views
0

我是新來的zend框架。Zend Framework - Zend Tool - 模塊錯誤:我使用Zend Tool創建模塊後出現錯誤

我用zend工具創建了一個zend項目,它的作品。然後我嘗試創建一個模塊,但是當我嘗試使用瀏覽器訪問它時,出現錯誤。

我的步驟:

  1. $ sudo zf create project mystore
  2. Zend庫庫內

測試http://localhost/mystore/public/工作

添加模塊存儲(不工作

  • $ sudo zf create module store
  • 添加到的application.ini路徑模塊

    resources.frontController.moduleDirectory = APPLICATION_PATH「/modules「

    resources.modules =」「

  • TEST1:http://localhost/mystore/public/store/

    TEST2:http://localhost/mystore/public/store/public/

    TEST3:http://localhost/mystore/public/modules/store/public/

    TEST1 + 2 + 3的結果:

    An error occurred 
    Page not found 
    Exception information: 
    
    Message: Invalid controller specified (index.php) 
    Stack trace: 
    
    #0 /var/www/mystore/library/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) 
    #1 /var/www/mystore/library/Zend/Application/Bootstrap/Bootstrap.php(97): Zend_Controller_Front->dispatch() 
    #2 /var/www/mystore/library/Zend/Application.php(366): Zend_Application_Bootstrap_Bootstrap->run() 
    #3 /var/www/mystore/public/index.php(25): Zend_Application->run() 
    #4 {main} 
    
    Request Parameters: 
    
    array (
        'module' => 'store', 
        'controller' => 'index.php', 
        'action' => 'index', 
    ) 
    

    謝謝,

    約瑟夫

    回答

    1

    我忘了讓這個命令創建我的模塊的索引控制器。

    $ sudo zf create controller index index-action-included=1 store 
    
    1

    其他動作/控制器是否在標準安裝上工作,在添加模塊之前的情況(網址爲http://localhost/mystore/public/)?這可能可能導致.htaccess文件中的重寫規則有問題。

    Zend中的路由似乎認爲,當你訪問你的模塊時,控制器是index.php。

    +0

    他們在我添加模塊之前工作。 現在也是http:// localhost/mystore/public/works。 – Yosef 2010-06-08 13:15:26