我创建了一个名为Admin的模块,并通过zend工具创建了一个控制器管理员。并补充follwoing在引导Zend Framework模块访问
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网址我得到“未找到”的错误。如果我访问的“http://本地主机/ zf_hemr /公/管理员” URL我收到以下错误:
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',
)
能否请你让我知道我在哪里出了错?
请问您可以添加您的项目目录结构吗? – Liyali 2012-02-22 18:24:55
当然。 https://skydrive.live.com/#cid=42249D719A3AB756&id=42249D719A3AB756!302 请查看上面的网址查看结构。 – Pradeep 2012-02-22 18:32:37