>  기사  >  백엔드 개발  >  找不到控制器,该如何解决

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

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으로 문의하세요.