I am using cakephp 2.0 ACL with Auth components.
My groups table contain 3 types admin, manager and user
I enabled the Routings in Core.php file
Configure::write('Routing.prefixes', array('admin','manager','user'));
default.ctp file contains following line to link to products:
$this -> Html -> link(__('Products'), array('controller' => 'products','action' => index'));
when i logged in as admin the above link is http://www.example.com/admin/products/index
when i logged in as manager the above link is http://www.example.com/products/index
the group name “manager” is not appending before products
I need the following output when i logged in as manager
http://www.example.com/manager/products/index
Try this line in the view:
As in, adding
'manager'=>trueto the list of options passed to theHtmlHelper::link()method, or whichever prefix name you need in the URL (i.e. admin, manager…).To work out which prefix is currently used, you can use this snippet:
You can then pass
$prefix=>trueas an option the Html link method.