Josh Bedo
Josh Bedo

Reputation: 3462

cakephp acl admin redirect problem

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.

Upvotes: 0

Views: 349

Answers (1)

Headshota
Headshota

Reputation: 21449

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

Upvotes: 1

Related Questions