Cakephp 无法识别 PagesController.php
我已经在我的项目中安装了 cakephp2.0,但现在我以前在 1.3 中工作的所有工作都不再在 2.0 中工作。
例如,PagesController 未被识别。当我转到索引页时,收到一条错误消息,指出
Notice (8): Undefined index: controller [CORE/Cake/Routing/Dispatcher.php, line 84]
Warning (512): _cake_core_ cache was unable to write 'cake_dev_en-us' to Apc cache [CORE/Cake/Cache/Cache.php, line 310]
Warning (512): _cake_core_ cache was unable to write 'cake_dev_en-us' to Apc cache [CORE/Cake/Cache/Cache.php, line 310]
Missing Controller
Error: Controller could not be found.
Error: Create the class Controller below in file: app/Controller/Controller.php
<? php
class Controller extends AppController {
}
Notice: If you want to customize this error message, create app/View/Errors/missing_controller.ctp
我没有 Controller.php,但有 PagesController.php。我希望我的应用程序识别页面而不是 Controller.php
如何强制它查找页面而不是 Controller.php?谢谢!
I've installed cakephp2.0 in my project but now all my work that used to work in 1.3 no longer works in 2.0.
For example, the PagesController is not being recognized. When I go to my index page, I get an error stating that
Notice (8): Undefined index: controller [CORE/Cake/Routing/Dispatcher.php, line 84]
Warning (512): _cake_core_ cache was unable to write 'cake_dev_en-us' to Apc cache [CORE/Cake/Cache/Cache.php, line 310]
Warning (512): _cake_core_ cache was unable to write 'cake_dev_en-us' to Apc cache [CORE/Cake/Cache/Cache.php, line 310]
Missing Controller
Error: Controller could not be found.
Error: Create the class Controller below in file: app/Controller/Controller.php
<? php
class Controller extends AppController {
}
Notice: If you want to customize this error message, create app/View/Errors/missing_controller.ctp
I dont have Controller.php but I do have PagesController.php. I want my app to recognize the Pages not the Controller.php
How can force it to look for Pages and not Controller.php? Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要将项目迁移到 2.0,或者只坚持使用 cake 1.3。
http://book.cakephp.org/2.0/en /appendices/2-0-migration-guide.html
You need to either migrate your project to 2.0, or just stick with cake 1.3.
http://book.cakephp.org/2.0/en/appendices/2-0-migration-guide.html
我可以修复错误:
通知 (8):未定义索引:控制器 [CORE/Cake/Routing/Dispatcher.php,第 84 行]。
当在 Config/routes.php 中添加此行时
I can fix error :
Notice (8): Undefined index: controller [CORE/Cake/Routing/Dispatcher.php, line 84].
when add this lines in Config/routes.php