0
我有一系列我希望编辑的项目。当编辑我的网址的当前格式显示为这样:导轨路线配置
http://mysite/items <---- Lists the items
http://mysite/items/1/ <------ more detailed view of items
http://mysite/items/1/edit <----- Ability to edit the item
路由配置我想尝试并应用到我的结构想是这样的:
http://mysite/items <---- Lists the items
http://mysite/item <---- Detailed view of the item by sending the item ID as POST data
http://mysite/item/edit <---- Edits the item by sending the item ID as POST data
这是严格意义上的事件的轨道路由配置,还是必须配置items
页面中的链接来专门构建URL。
只是我的看法,如果你设置URL像'http:// mysite/item',你怎么知道你将显示哪个ID的项目? – Thanh