0

我是 zend 框架的新手。

我用 zend 工具创建了一个 zend 项目,它的工作原理。然后我尝试创建一个模块,但是当我尝试使用浏览器访问它时,出现错误。

我的步骤:

  1. $ sudo zf create project mystore
  2. Zend 库放在库中

测试http://localhost/mystore/public/工作

添加模块存储(不工作

  1. $ sudo zf create module store
  2. 添加到模块的application.ini路径

    resources.frontController.moduleDirectory = APPLICATION_PATH "/modules"

    资源.modules = ""

测试1:http://localhost/mystore/public/store/

test2:http://localhost/mystore/public/store/public/

测试3 :http://localhost/mystore/public/modules/store/public/

测试1+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',
)  

谢谢,

约瑟夫

4

2 回答 2

1

其他操作/控制器是否适用于标准安装,即添加模块之前的情况(在 URL http://localhost/mystore/public/ 处)?您的 .htaccess 文件中的重写规则可能有问题。

Zend 中的路由似乎认为当您访问您的模块时,控制器是 index.php。

于 2010-06-08T13:03:31.330 回答
1

我忘记创建这个命令来创建我的模块的索引控制器。

$ sudo zf create controller index index-action-included=1 store
于 2010-06-08T14:51:52.817 回答