【发布时间】:2012-02-22 18:13:13
【问题描述】:
我创建了一个名为 Admin 的模块,并通过 zend 工具创建了一个控制器 Admin。并在引导程序中添加了以下代码
protected function _initAutoLoad ()
{
$front = Zend_Controller_Front::getInstance();
$front->setControllerDirectory(array(
'default' => APPLICATION_PATH . '/default/controllers' ,
'Admin' => APPLICATION_PATH . '/Admin/controllers'
));
$autoloader = Zend_Loader_Autoloader::getInstance();
$autoloader->suppressNotFoundWarnings(false);
}
但如果我访问http://localhost/zf_hemr/Admin url,我会收到“未找到”错误。如果我正在访问“http://localhost/zf_hemr/public/Admin”网址,我会收到以下错误:
Page not found
Exception information:
Message: Invalid controller specified (index)
Stack trace:
#0 D:\web\www\zf_hemr\library\Zend\Controller\Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#1 D:\web\www\zf_hemr\library\Zend\Application\Bootstrap\Bootstrap.php(97): Zend_Controller_Front->dispatch()
#2 D:\web\www\zf_hemr\library\Zend\Application.php(366): Zend_Application_Bootstrap_Bootstrap->run()
#3 D:\web\www\zf_hemr\public\index.php(26): Zend_Application->run()
#4 {main}
Request Parameters:
array (
'module' => 'Admin',
'controller' => 'index',
'action' => 'index',
)
你能告诉我哪里出错了吗?
【问题讨论】:
-
能否请您添加您的项目目录结构?
-
当然。 skydrive.live.com/…请看上面的url查看结构。
标签: zend-framework