首頁  >  文章  >  後端開發  >  找不到控制器,该如何解决

找不到控制器,该如何解决

WBOY
WBOY原創
2016-06-13 13:52:20985瀏覽

找不到控制器
本人在使用zend framework时出的一个错误,就是在打开首页index.php的时候都可以正常显示
但打开其它页面都无法显示(例如127.0.0.1/news),但在Controllers文件夹中是存在NewsController.php这个文件的
显示如下错误:

Fatal error: Uncaught exception 'Zend_Controller_Dispatcher_Exception' with message 'Invalid controller specified (error)' in D:\web\ztw\Zend\Controller\Dispatcher\Standard.php:248 Stack trace: #0 D:\web\ztw\Zend\Controller\Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) #1 F:\myphp\index.php(9): Zend_Controller_Front->dispatch() #2 {main} thrown in D:\web\ztw\Zend\Controller\Dispatcher\Standard.php on line 248


反正就是首页正常,其实都打不开,求解。

------解决方案--------------------
controller -> action

没有指定actiong,默认是index,如果view里面没有index.phtml文件,肯定就会报错了

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn