时间:2021-07-01 10:21:17 帮助过:20人阅读
Fatal error: Uncaught exception 'Zend_Controller_Dispatcher_Exception' with message 'Invalid controller specified (error)' in C:\php\library\Zend\Controller\Dispatcher\Standard.php:241 Stack trace: #0 C:\php\library\Zend\Controller\Front.php(934): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #1 G:\WEB\php\Z\index.php(36): Zend_Controller_Front->dispatch() #2 {main} thrown in C:\php\library\Zend\Controller\Dispatcher\Standard.php on line 241
setScriptPath('./application/views/scripts/index/');//设置模板显示路径 $registry['view'] = $view;//注册View //配置数据库参数,并连接数据库 $config=new Zend_Config_Ini('./application/config/config.ini',null, true); Zend_Registry::set('config',$config); $dbAdapter=Zend_Db::factory($config->general->db->adapter,$config->general->db->config->toArray()); $dbAdapter->query('SET NAMES UTF8'); Zend_Db_Table::setDefaultAdapter($dbAdapter); Zend_Registry::set('dbAdapter',$dbAdapter); //设置控制器 $frontController =Zend_Controller_Front::getInstance(); $frontController->setBaseUrl('/z')//设置基本路径 ->setParam('noViewRenderer', true) ->setControllerDirectory('./application/controllers') ->throwExceptions(False) ->dispatch();
$frontCtrl->throwExceptions(true);// true 为抛出异常,false 为不抛出 $frontCtrl->setParam('useDefaultControllerAlways', true); // true 为 404 总是重定向到默认控制器 $this->_frontCtrl->registerPlugin( new Zend_Controller_Plugin_ErrorHandler(array('module'=>'error', 'controller'=>'error', 'action'=>'error')) );