错误:重定向到Croogo、cakephp中每个控制器操作中的登录
下午好 我目前正在使用croogno版本2.0.0.dev.2,我试图添加我自己的名为itemscontroller的控制器(不是插件),它显示项目。我遇到了两个问题: 1.每次我尝试为我的项目分页时,它总是将我重定向到登录。登录后,我会被重定向到我要登录的页面,但如果我尝试它要求登录的任何其他链接,我会再次被重定向到该页面。问题在哪里?如何解决错误:重定向到Croogo、cakephp中每个控制器操作中的登录,cakephp,cakephp-2.0,croogo,Cakephp,Cakephp 2.0,Croogo,下午好 我目前正在使用croogno版本2.0.0.dev.2,我试图添加我自己的名为itemscontroller的控制器(不是插件),它显示项目。我遇到了两个问题: 1.每次我尝试为我的项目分页时,它总是将我重定向到登录。登录后,我会被重定向到我要登录的页面,但如果我尝试它要求登录的任何其他链接,我会再次被重定向到该页面。问题在哪里?如何解决 在我的分页中,按钮链接包含多余的URL,这是不必要的。例如,链接变为http://localhost/myapp/items/page:2/page:
http://localhost/myapp/items/page:2/page:2?%2Fitems=
而不仅仅是http://localhost/myapp/items/page:2/
李>
有人能帮我解决这些问题吗?我建议尝试通过烘焙工具创建MVC文件,并与手写文件进行比较 例如:
$ Console/cake bake model Item
Welcome to CakePHP v2.5.0-dev Console
---------------------------------------------------------------
App : croogo-app
Path: /home/rachman/work/personal/deploy/croogo-app/
---------------------------------------------------------------
---------------------------------------------------------------
You have more than one set of templates installed.
Please choose the template set you wish to use:
---------------------------------------------------------------
1. croogo
2. default
Which bake theme would you like to use? (1/2)
[1] > 1
Baking model class for Item...
Creating file /home/rachman/work/personal/deploy/croogo-app/Model/Item.php
Wrote `/home/rachman/work/personal/deploy/croogo-app/Model/Item.php`
Baking test fixture for Item...
Creating file /home/rachman/work/personal/deploy/croogo-app/Test/Fixture/ItemFixture.php
Wrote `/home/rachman/work/personal/deploy/croogo-app/Test/Fixture/ItemFixture.php`
Bake is detecting possible fixtures...
Baking test case for Item Model ...
Creating file /home/rachman/work/personal/deploy/croogo-app/Test/Case/Model/ItemTest.php
Wrote `/home/rachman/work/personal/deploy/croogo-app/Test/Case/Model/ItemTest.php`
$ Console/cake bake controller Items --public
Welcome to CakePHP v2.5.0-dev Console
---------------------------------------------------------------
App : croogo-app
Path: /home/rachman/work/personal/deploy/croogo-app/
---------------------------------------------------------------
Baking basic crud methods for Items
---------------------------------------------------------------
You have more than one set of templates installed.
Please choose the template set you wish to use:
---------------------------------------------------------------
1. croogo
2. default
Which bake theme would you like to use? (1/2)
[1] > 1
Baking controller class for Items...
Creating file /home/rachman/work/personal/deploy/croogo-app/Controller/ItemsController.php
Wrote `/home/rachman/work/personal/deploy/croogo-app/Controller/ItemsController.php`
Bake is detecting possible fixtures...
Baking test case for Items Controller ...
Creating file /home/rachman/work/personal/deploy/croogo-app/Test/Case/Controller/ItemsControllerTest.php
Wrote `/home/rachman/work/personal/deploy/croogo-app/Test/Case/Controller/ItemsControllerTest.php`
$ Console/cake bake view Items
Welcome to CakePHP v2.5.0-dev Console
---------------------------------------------------------------
App : croogo-app
Path: /home/rachman/work/personal/deploy/croogo-app/
---------------------------------------------------------------
---------------------------------------------------------------
You have more than one set of templates installed.
Please choose the template set you wish to use:
---------------------------------------------------------------
1. croogo
2. default
Which bake theme would you like to use? (1/2)
[1] > 2
Baking `index` view file...
Creating file /home/rachman/work/personal/deploy/croogo-app/View/Items/index.ctp
Wrote `/home/rachman/work/personal/deploy/croogo-app/View/Items/index.ctp`
Baking `view` view file...
Creating file /home/rachman/work/personal/deploy/croogo-app/View/Items/view.ctp
Wrote `/home/rachman/work/personal/deploy/croogo-app/View/Items/view.ctp`
Baking `add` view file...
Creating file /home/rachman/work/personal/deploy/croogo-app/View/Items/add.ctp
Wrote `/home/rachman/work/personal/deploy/croogo-app/View/Items/add.ctp`
Baking `edit` view file...
Creating file /home/rachman/work/personal/deploy/croogo-app/View/Items/edit.ctp
Wrote `/home/rachman/work/personal/deploy/croogo-app/View/Items/edit.ctp`
请注意,烘焙视图时,我选择了默认模板
使用这些生成的文件,添加新项目和分页记录似乎没有问题