开发者

How can I route users to different functions based on their privileges in CakePHP?

This may have been asked before, and I have seen similar solutions... Perhaps I am thinking about this incorrectly.

I would like to have one link called user/edit if the user is an admin it should route to admin_ if they are a basic user it should route to user_ etc... Is there a way to do this in a slick way?

I have seen solutions that k开发者_如何学编程ind of do the opposite like type in user/admin_edit and it takes you to user/edit...


You will want to take a look at prefix routing.

http://book.cakephp.org/view/544/Prefix-Routing

Combine this with Cakes built in Auth/ACL and you should have no problem.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜