2012-01-21 00:44:00
Fatal error: Uncaught exception 'Zend_Controller_Dispatcher_Exception' with message 'Invalid controller specified (zned)' in D:\AppServ\www\zned\library\Zend\Controller\Dispatcher\Standard.php:242 Stack trace: #0 D:\AppServ\www\zned\library\Zend\Controller\Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #1 D:\AppServ\www\zned\index.php(27): Zend_Controller_Front->dispatch() #2 {main} thrown in D:\AppServ\www\zned\library\Zend\Controller\Dispatcher\Standard.php on line 242
zendfremword 遇到的问题,哪位知道是哪里要配置吗
controller 没有找到 看看你路由实例化了吗 class IndexController extends Zend_Controller_Action
{
function init() //__construct 代替初始化函数
{
$this->registry = Zend_Registry::getInstance();
$this->view = $this->registry['view'];
$this->view->baseUrl = $this->_request->getBaseUrl();
}
/*
* Action(动作)!
*/
function indexAction()
{
//这里给变量赋值,在index.html模板里显示
$this->view->word = '测试一个内容';
$this->view->php= array("php100视频教程","测试zf");
echo $this->view->render('index.html');//显示模版
}
这个是控制器代码,,哪里要配置?
$frontController =Zend_Controller_Front::getInstance();
$frontController->setBaseUrl('/zendframework')//设置基本路径
->setParam('noViewRenderer', true)
->setControllerDirectory('./application/controllers')
->throwExceptions(true)
->dispatch();
?>控制器要怎么设置,我都是按教程原封不动的复制下来的,新手不懂 setBaseUrl('/zendframework')//设置基本路径
改路径!!! setBaseUrl() 直着这么写 成功了 不报错了