私は、認証コンポーネントでcakephp 2.0 ACLを使用しています。 3種類の管理者、管理者およびユーザーが含まれているテーブル私のグループは Cakephpルーティングで追加しないユーザタイプ(グループ名)の名前
私はConfigure::write('Routing.prefixes', array('admin','manager','user'));
default.ctpにファイルが製品にリンクする次の行を含むファイルcore.phpの中にルーティングを有効に:
$this -> Html -> link(__('Products'), array('controller' => 'products','action' => index'));
私が管理者として上記のリンクにログインしたときhttp://www.example.com/admin/products/index
私がマネージャーとしてログインしたとき、上記のリンクはhttp://www.example.com/products/index グループ名 "manage同様に
$this->Html->link(__('Products'), array('controller' => 'products','action' => index','manager'=>true));
を、へ'manager'=>true
を追加:r」はビューでこのラインを試してみてください、私は
http://www.example.com/manager/products/index
私はmanager => TRUEを与え、ADMINとしてログインしている間はURLはhttp://www.example.com/manager/products/indexです。 – AnNaMaLaI
はい、プレフィックスの名前を本当の値として渡すので、あなたの場合は '' admin '=> true'と設定します。 –
adminとmanagerの両方に同じリンクを使用しています。この$ this-> Html-> link(__( 'Products')、array( 'controller' => 'products'、 'action' = > index '、' manager '=> true、' admin '=> true));正しい ? – AnNaMaLaI