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