发新话题
打印

zendframework提示找不到contrller?

zendframework提示找不到contrller?

我把index.php、application\controllers\IndexController.php、application\views\scripts\index\index.phtml都设置好了
我的index.php:
<?php
error_reporting(E_ALL|E_STRICT);
date_default_timezone_set('Asia/Chongqing');

set_include_path('.'.PATH_SEPARATOR.'./library'.PATH_SEPARATOR.'./application/models'.PATH_SEPARATOR.get_include_path());
include('zend/loader.php');
function __autoLoad($className)
{
        Zend_Loader::loadClass($className);
}

$frontcontroller=Zend_Controller_Front::getInstance();
$frontcontroller->throwExceptions(true);
$frontcontroller->setControllerDirectory('./application/contrllers');
$view=new Zend_View();
$view->setScriptPath('./application/views');
$frontcontroller->dispatch();
?>
IndexController.php:
<?php
class IndexController extends Zend_Controller_Action{
        function indexAction(){
      echo "ddddddddddddddddd";
        }
}
?>
index.phtml随便写了些文字,但是调试出现:
Uncaught exception 'Zend_Controller_Dispatcher_Exception' with message 'Invalid controller specified (index)' in D:\www\zf\library\Zend\Controller\Dispatcher\Standard.php:249 Stack trace: #0 D:\www\zf\library\Zend\Controller\Front.php(914): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #1 D:\www\zf\index.php(18): Zend_Controller_Front->dispatch() #2 {main} thrown in D:\www\zf\library\Zend\Controller\Dispatcher\Standard.php on line 24
这是怎么回事啊???????????????

TOP

问题已解决,我晕!
$frontcontroller->setControllerDirectory('./application/contrllers');
controller写成contrllers了

TOP

发新话题