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

WBOY
Release: 2016-06-13 13:52:20
Original
1034 people have browsed it

找不到控制器
本人在使用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文件,肯定就会报错了

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template