2
我使用cakephp 2.0 ACL與Auth組件。 我的組表包含三種類型的管理員,經理和用戶Cakephp用戶類型(組名稱)名稱不附加在路由
我啓用了core.php中的工藝路線文件
Configure::write('Routing.prefixes', array('admin','manager','user'));
default.thtml中文件包含以下行鏈接到產品:
$this -> Html -> link(__('Products'), array('controller' => 'products','action' => index'));
當我以管理員身份登錄時,上面的鏈接是http://www.example.com/admin/products/index
當我以管理員身份登錄時,上面的鏈接是http://www.example.com/products/index 組名「manage R」產品
我需要下面的輸出,當我登錄作爲經理
http://www.example.com/manager/products/index
如果我給manager => TRUE,並且以ADMIN身份登錄,則URL是http://www.example.com/manager/products/index。 – AnNaMaLaI 2012-03-13 07:39:57
是的 - 你傳遞的前綴名稱的值爲真,所以你會設置''admin'=> true'在你的情況。 – 2012-03-13 08:49:57
我對管理員和管理員都使用相同的鏈接..所以,如果我給這個$ this-> Html-> link(__('Products'),array('controller'=>'products','action'= > index','manager'=> true,'admin'=> true));是正確的 ? – AnNaMaLaI 2012-03-13 10:56:32