开发者

cakephp acl admin redirect problem

开发者 https://www.devze.com 2023-02-23 14:31 出处:网络
I currently have a form where you put in two variables and on submit it redirects to a url like this:

I currently have a form where you put in two variables and on submit it redirects to a url like this:

http://example.com/deal_user_coupons/check_qr/$var1/4var2

but when logged in as admin it goes to:

http://example.com/albuquerque/admin/deal_user_coupons/开发者_如何转开发check_qr/$var1/$var2

Which makes it show a 404 page.

I was wondering how to get rid of the admin directory slash. I tried looking in the documentation and at a few acl tutorials but nothing came close.


You can redirect form on the exact page you need using url option.

$this->Form->create('Shutk',array('url'=>array('controller'=>'my_controller',
                                  'action'=>'my_action',
                                  'admin'=>false)
                                  )
                   );

don't forget to use in url array. this will remove admin prefix from action attribute of the form.

'admin'=>false
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号