我想學習Zend Framework 1.12模塊目錄結構,所以我手動創建它。到目前爲止,我已經通過將這個模塊添加到位於我的應用程序文件夾下的Bootstrap.php中來使用默認模塊。試圖訪問我的Zend模塊時得到404
$this->bootstrap("frontController");
$front = $this->getResource("frontController");
$front->addModuleDirectory(APPLICATION_PATH . '/modules');
我嘗試使用的application.ini與下面的設置要做到這一點,但它不停地給我一個異常說「與前端控制器註冊號默認控制器目錄」。
resources.frontController.defaultController = "index"
resources.frontController.defaultAction = "index"
resources.frontController.defaultModule = "default"
resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"
resources.modules[] = ""
這裏是我的目錄結構:
root
|
+- application
|
+- configs
| |
| +- application.ini
|
+- modules
|
+- default
| |
| +- controllers
| | |
| | +- IndexController.php
| |
| +- views
| |
| +- scripts
| |
| +- index
| |
| +- index.phtml
|
+- signup
|
+- controllers
| |
| +- IndexController.php
|
+- views
|
+- scripts
|
+- index
|
+- index.phtml
這是我的重寫規則:
RewriteEngine On
RewriteRule ^myroot/.*$ index.php [NC]
我嘗試訪問http://mysite.com/root/signup但我不斷收到404我這麼想設置模塊在Zend?
更新: 如果我將我的默認設置爲註冊,它的工作原理。
resources.frontController.defaultModule = "signup"
我最好的猜測,現在是規則被不其重定向到index.php當我進入
http://www.mysite.com/root/signup
是/根/主index.php腳本的位置? – Orangepill
是的,那是我的主要index.php Zend所在的設置。 – kailoon
只爲咯咯地嘗試去http://mysite.com/root/signup/index/index – Orangepill