我在Cakephp中有一个看起来像
的页面www.example.com/posts/next_posts
即。我有app/View/posts/next_posts.ctp
但我在数据库中有Categories1,Categories2,Categories3,....
如何更改URL以便分配数据库变量,它看起来像
www.example.com/categories1/next_posts
www.example.com/categories2/next_posts
www.example.com/categories3/next_posts
答案 0 :(得分:0)
使用路由器。阅读本章:
http://book.cakephp.org/3.0/en/development/routing.html
它会将URL映射到控制器和操作,并根据URL传递参数。如果您正在寻找,那么该页面上也有一些示例。