Introduction: This is a detailed page of administrator permissions in CakePHP. It introduces PHP, related knowledge, skills, experience, and some PHP source code.
Class = 'pingjiaf' frameborder = '0' src = 'HTTP: // biancheng.dnbc?info/pingjia.php? Id = 336643 'rolling = 'no'>
Sometimes we need an administrator for some users to make modifications. Usually through
/Admin/users/edit/5
This link is implemented. In CakePHP, Administrator routing can be set in the Kernel configuration file routing. admin.
Configure: Write ('routing. admin', 'admin ');
In your controller, any actionAdmin _
Can be called at the beginning, for example, users,Userscontroller
The function name isAdmin_edit
In this way.
You can use a route to customize the prefix.
Router: connect ('/profiles/: Controller/: action', array ('prefix' => 'profiles '));
Prefix any call to Profiles
Profiles _
, Our users example:
/Profiles/users/edit/5
Will call
Userscontroller
Of
Profiles_edit
. Remember, when using HTML help to create a link, you can directly use a function with a prefix. The following is an example of creating a link using HTML help:
Echo $ HTML-> Link ('edit your profile ', array ('controller' => 'users', 'Action' => 'profiles _ edit '));
More articles on "administrator permissions in CakePHP"
Love J2EE follow Java Michael Jackson video station JSON online tools
Http://biancheng.dnbcw.info/php/336643.html pageno: 10.