@@ -16,7 +16,7 @@ CodeIgniter 通过其资源路由和 `ResourceController` 可以轻松创建资
1616资源路由
1717***************
1818
19- 你可以使用 ``resource() `` 方法快速为单个资源创建一小 handful 的 RESTful 路由。这会创建完全 CRUD 资源所需的最常见的 5 个路由: 创建新资源、更新现有资源、列出所有该资源、显示单个资源以及删除单个资源 。第一个参数是资源名称:
19+ 你可以使用 ``resource() `` 方法快速为单个资源创建一组 RESTful 路由。这将创建用于完整 CRUD 操作的 5 个最常用的路由: 创建新资源、更新现有资源、列出所有资源、显示单个资源和删除单个资源 。第一个参数是资源名称:
2020
2121.. literalinclude :: restful/001.php
2222
@@ -143,14 +143,14 @@ Presenter/Controller 对比
143143================ ========= ====================== ======================== ====================== ======================
144144**New ** GET photos/new photos/new ``new() `` ``new() ``
145145**Create ** POST photos photos ``create() `` ``create() ``
146- 创建 (别名) POST photos/create ``create() ``
146+ Create (别名) POST photos/create ``create() ``
147147**List ** GET photos photos ``index() `` ``index() ``
148148**Show ** GET photos/(:segment) photos/(:segment) ``show($id = null) `` ``show($id = null) ``
149- 显示 (别名) GET photos/show/(:segment) ``show($id = null) ``
149+ Show (别名) GET photos/show/(:segment) ``show($id = null) ``
150150**Edit ** GET photos/(:segment)/edit photos/edit/(:segment) ``edit($id = null) `` ``edit($id = null) ``
151151**Update ** PUT/PATCH photos/(:segment) ``update($id = null) ``
152- 更新 (网页安全) POST photos/(:segment) photos/update/(:segment) ``update($id = null) `` ``update($id = null) ``
152+ Update (网页安全) POST photos/(:segment) photos/update/(:segment) ``update($id = null) `` ``update($id = null) ``
153153**Remove ** GET photos/remove/(:segment) ``remove($id = null) ``
154154**Delete ** DELETE photos/(:segment) ``delete($id = null) ``
155- 删除 (网页安全) POST photos/delete/(:segment) ``delete($id = null) `` ``delete($id = null) ``
155+ Delete (网页安全) POST photos/delete/(:segment) ``delete($id = null) `` ``delete($id = null) ``
156156================ ========= ====================== ======================== ====================== ======================
0 commit comments