Skip to content

Commit 12098f9

Browse files
authored
Merge pull request #5409 from kenjis/fix-docs-restful.rst
docs: improve restful.rst
2 parents cd523c7 + 36ae946 commit 12098f9

1 file changed

Lines changed: 13 additions & 13 deletions

File tree

user_guide_src/source/incoming/restful.rst

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ name::
4747
.. important:: The routes are matched in the order they are specified, so if you have a resource photos above a get 'photos/poll' the show action's route for the resource line will be matched before the get line. To fix this, move the get line above the resource line so that it is matched first.
4848

4949
The second parameter accepts an array of options that can be used to modify the routes that are generated. While these
50-
routes are geared toward API-usage, where more methods are allowed, you can pass in the 'websafe' option to have it
50+
routes are geared toward API-usage, where more methods are allowed, you can pass in the ``websafe`` option to have it
5151
generate update and delete methods that work with HTML forms::
5252

5353
$routes->resource('photos', ['websafe' => 1]);
@@ -70,7 +70,7 @@ the controller that should be used::
7070
Change the Placeholder Used
7171
---------------------------
7272

73-
By default, the ``segment`` placeholder is used when a resource ID is needed. You can change this by passing
73+
By default, the ``(:segment)`` placeholder is used when a resource ID is needed. You can change this by passing
7474
in the ``placeholder`` option with the new string to use::
7575

7676
$routes->resource('photos', ['placeholder' => '(:num)']);
@@ -81,24 +81,24 @@ in the ``placeholder`` option with the new string to use::
8181
Limit the Routes Made
8282
---------------------
8383

84-
You can restrict the routes generated with the ``only`` option. This should be an array or comma separated list of method names that should
84+
You can restrict the routes generated with the ``only`` option. This should be **an array** or **comma separated list** of method names that should
8585
be created. Only routes that match one of these methods will be created. The rest will be ignored::
8686

8787
$routes->resource('photos', ['only' => ['index', 'show']]);
8888

89-
Otherwise you can remove unused routes with the ``except`` option. This option run after ``only``::
89+
Otherwise you can remove unused routes with the ``except`` option. This should also be **an array** or **comma separated list** of method names. This option run after ``only``::
9090

9191
$routes->resource('photos', ['except' => 'new,edit']);
9292

93-
Valid methods are: index, show, create, update, new, edit and delete.
93+
Valid methods are: ``index``, ``show``, ``create``, ``update``, ``new``, ``edit`` and ``delete``.
9494

9595
ResourceController
9696
============================================================
9797

98-
The `ResourceController` provides a convenient starting point for your RESTful API,
98+
The ``ResourceController`` provides a convenient starting point for your RESTful API,
9999
with methods that correspond to the resource routes above.
100100

101-
Extend it, over-riding the `modelName` and `format` properties, and then
101+
Extend it, over-riding the ``modelName`` and ``format`` properties, and then
102102
implement those methods that you want handled.::
103103

104104
<?php
@@ -175,7 +175,7 @@ the controller that should be used::
175175
Change the Placeholder Used
176176
---------------------------
177177

178-
By default, the ``segment`` placeholder is used when a resource ID is needed. You can change this by passing
178+
By default, the ``(:segment)`` placeholder is used when a resource ID is needed. You can change this by passing
179179
in the ``placeholder`` option with the new string to use::
180180

181181
$routes->presenter('photos', ['placeholder' => '(:num)']);
@@ -186,25 +186,25 @@ in the ``placeholder`` option with the new string to use::
186186
Limit the Routes Made
187187
---------------------
188188

189-
You can restrict the routes generated with the ``only`` option. This should be an array or comma separated list of method names that should
189+
You can restrict the routes generated with the ``only`` option. This should be **an array** or **comma separated list** of method names that should
190190
be created. Only routes that match one of these methods will be created. The rest will be ignored::
191191

192192
$routes->presenter('photos', ['only' => ['index', 'show']]);
193193

194-
Otherwise you can remove unused routes with the ``except`` option. This option run after ``only``::
194+
Otherwise you can remove unused routes with the ``except`` option. This should also be **an array** or **comma separated list** of method names. This option run after ``only``::
195195

196196
$routes->presenter('photos', ['except' => 'new,edit']);
197197

198-
Valid methods are: index, show, new, create, edit, update, remove and delete.
198+
Valid methods are: ``index``, ``show``, ``new``, ``create``, ``edit``, ``update``, ``remove`` and ``delete``.
199199

200200
ResourcePresenter
201201
============================================================
202202

203-
The `ResourcePresenter` provides a convenient starting point for presenting views
203+
The ``ResourcePresenter`` provides a convenient starting point for presenting views
204204
of your resource, and processing data from forms in those views,
205205
with methods that align to the resource routes above.
206206

207-
Extend it, over-riding the `modelName` property, and then
207+
Extend it, over-riding the ``modelName`` property, and then
208208
implement those methods that you want handled.::
209209

210210
<?php

0 commit comments

Comments
 (0)