蛋糕PHP错误版本1.3
CakePHP 错误 一个错误是这样的 错误:在此服务器上找不到请求的地址“/” -
我为 photocategory 创建了模型、视图、控制器,并在路由中添加了路径,如下所示
Router::connect('/admin/photocategory', array('controller' = > '照片类别', '管理' => true));
但是当点击 siteroot.admin/photocategory 时出现错误 在此服务器上找不到请求的地址“/” –
CakePHP Error
one error comes like this
Error: The requested address “/” was not found on this server –
i created model, view,controller for photcategory and add the path in routes like following
Router::connect('/admin/photocategory', array('controller' => 'photocategory', 'admin' => true));
but when clicking siteroot.admin/photocategory error comes as
The requested address “/” was not found on this server –
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的意思是在这里启用管理路由吗?管理路由允许您使用类似 http://yoursite.com/admin/photocategory/add
如果您想这样做,那么您的 Router::connect 调用应该如下所示:
Router::connect('/admin', array('controller' => 'photocategory', 'action'=>'index', 'admin' => true));
if您只是想获得一个正常的网址,例如 http://yoursite.com/photocategory/add,那么您不需要修改配置默认配置文件 - 您不需要添加 Router::connect 行。
以下是蛋糕手册中有关默认路由的更多信息:
http://book.cakephp.org/view/945/Routes -配置#Default-Routing-946
Do you mean to be enabling admin routing here? admin routing allows you to use a url like http://yoursite.com/admin/photocategory/add
if you're looking to do that, then your Router::connect call should look like this:
Router::connect('/admin', array('controller' => 'photocategory', 'action'=>'index', 'admin' => true));
if you're just looking to get a normal url like http://yoursite.com/photocategory/add, then you do not need to modify the config default config file - you do not need to add your Router::connect line.
Here's more info on the default routing in the cake manual:
http://book.cakephp.org/view/945/Routes-Configuration#Default-Routing-946