Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
以前可能有人问过这个问题,我也看到过类似的解决方案……也许我想错了。
我想要一个名为 user/edit 的链接,如果用户是管理员,它应该路由到 admin_ 如果他们是基本用户,它应该路由到 user_ 等......有没有办法以一种巧妙的方式做到这一点?
我已经看到了与 user/admin_edit 中的类型相反的解决方案,它会将您带到 user/edit...
您将需要查看前缀路由。
http://book.cakephp.org/view/544/Prefix-Routing
将此与 Auth/ACL 中内置的 Cakes 结合起来,您应该没有问题。