当控制器不存在时 cakePHP 2.0 路由
当找不到控制器或插件时。我希望它最终到达一个特定的控制器,该控制器检查 ulr(db),并检查我的 cms 中是否有与其相关的页面。 所以,在默认的 cakephp 路由之后我不想丢失 控制器错误,但我想路由到控制器。 我想保留默认蛋糕路由的所有功能(插件、管理路由)。 我怎样才能做到这一点?
When a Controller or Plugin isn't found. I want it to end up at a specific controller that examines the ulr(db), and checks if there's a page related to it in my cms.
So, after the default cakephp routing I don't want the missing
controller error but I want to route to a controller.
I want to keep all the functionality (plugin,admin route) from the default cake route.
How can I accomplish this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
已编辑
我更改了答案以给出更简洁的解释
创建自定义异常处理程序文件并覆盖 error404 函数。请参阅此文档获取帮助。
Edited
I've changed my answer to give a more concise explanation
Create a custom exception handler file and override the error404 function. Reference this documentation for help.