Skip to content

Commit c6de39f

Browse files
authored
Merge pull request #7298 from kenjis/fix-docs-restful.rst
docs: fix section title marks in restful.rst
2 parents 1df1bec + 64cd546 commit c6de39f

1 file changed

Lines changed: 18 additions & 12 deletions

File tree

user_guide_src/source/incoming/restful.rst

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
#########################
12
RESTful Resource Handling
2-
#######################################################
3+
#########################
34

45
.. contents::
56
:local:
@@ -22,8 +23,9 @@ most "RESTful" your application would be considered.
2223
CodeIgniter makes it easy to create RESTful APIs for your resources,
2324
with its resource routes and `ResourceController`.
2425

26+
***************
2527
Resource Routes
26-
============================================================
28+
***************
2729

2830
You can quickly create a handful of RESTful routes for a single resource with the ``resource()`` method. This
2931
creates the five most common routes needed for full CRUD of a resource: create a new resource, update an existing one,
@@ -43,23 +45,23 @@ generate update and delete methods that work with HTML forms:
4345
.. literalinclude:: restful/002.php
4446

4547
Change the Controller Used
46-
--------------------------
48+
==========================
4749

4850
You can specify the controller that should be used by passing in the ``controller`` option with the name of
4951
the controller that should be used:
5052

5153
.. literalinclude:: restful/003.php
5254

5355
Change the Placeholder Used
54-
---------------------------
56+
===========================
5557

5658
By default, the ``(:segment)`` placeholder is used when a resource ID is needed. You can change this by passing
5759
in the ``placeholder`` option with the new string to use:
5860

5961
.. literalinclude:: restful/004.php
6062

6163
Limit the Routes Made
62-
---------------------
64+
=====================
6365

6466
You can restrict the routes generated with the ``only`` option. This should be **an array** or **comma separated list** of method names that should
6567
be created. Only routes that match one of these methods will be created. The rest will be ignored:
@@ -72,8 +74,9 @@ Otherwise you can remove unused routes with the ``except`` option. This should a
7274

7375
Valid methods are: ``index``, ``show``, ``create``, ``update``, ``new``, ``edit`` and ``delete``.
7476

77+
******************
7578
ResourceController
76-
============================================================
79+
******************
7780

7881
The ``ResourceController`` provides a convenient starting point for your RESTful API,
7982
with methods that correspond to the resource routes above.
@@ -87,8 +90,9 @@ The routing for this would be:
8790

8891
.. literalinclude:: restful/008.php
8992

93+
****************
9094
Presenter Routes
91-
============================================================
95+
****************
9296

9397
You can quickly create a presentation controller which aligns
9498
with a resource controller, using the ``presenter()`` method. This
@@ -111,23 +115,23 @@ controller. You need to distinguish them, for instance:
111115
The second parameter accepts an array of options that can be used to modify the routes that are generated.
112116

113117
Change the Controller Used
114-
--------------------------
118+
==========================
115119

116120
You can specify the controller that should be used by passing in the ``controller`` option with the name of
117121
the controller that should be used:
118122

119123
.. literalinclude:: restful/011.php
120124

121125
Change the Placeholder Used
122-
---------------------------
126+
===========================
123127

124128
By default, the ``(:segment)`` placeholder is used when a resource ID is needed. You can change this by passing
125129
in the ``placeholder`` option with the new string to use:
126130

127131
.. literalinclude:: restful/012.php
128132

129133
Limit the Routes Made
130-
---------------------
134+
=====================
131135

132136
You can restrict the routes generated with the ``only`` option. This should be **an array** or **comma separated list** of method names that should
133137
be created. Only routes that match one of these methods will be created. The rest will be ignored:
@@ -140,8 +144,9 @@ Otherwise you can remove unused routes with the ``except`` option. This should a
140144

141145
Valid methods are: ``index``, ``show``, ``new``, ``create``, ``edit``, ``update``, ``remove`` and ``delete``.
142146

147+
*****************
143148
ResourcePresenter
144-
============================================================
149+
*****************
145150

146151
The ``ResourcePresenter`` provides a convenient starting point for presenting views
147152
of your resource, and processing data from forms in those views,
@@ -156,8 +161,9 @@ The routing for this would be:
156161

157162
.. literalinclude:: restful/016.php
158163

164+
*******************************
159165
Presenter/Controller Comparison
160-
=============================================================
166+
*******************************
161167

162168
This table presents a comparison of the default routes created by `resource()`
163169
and `presenter()` with their corresponding Controller functions.

0 commit comments

Comments
 (0)