Skip to content

Commit 2fd0422

Browse files
committed
Add note to clarify order
1 parent 90b840d commit 2fd0422

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

user_guide_src/source/incoming/restful.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ name::
4242
$routes->patch('photos/(:segment)', 'Photos::update/$1');
4343
$routes->delete('photos/(:segment)', 'Photos::delete/$1');
4444

45+
.. note:: The ordering above is for clarity, whereas the actual order the routes are created in, in RouteCollection, ensures proper route resolution
46+
4547
.. 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.
4648

4749
The second parameter accepts an array of options that can be used to modify the routes that are generated. While these
@@ -149,6 +151,8 @@ Its usage is similar to the resosurce routing::
149151
$routes->get('photos/remove/(:segment)', 'Photos::remove/$1');
150152
$routes->post('photos/delete/(:segment)', 'Photos::update/$1');
151153

154+
.. note:: The ordering above is for clarity, whereas the actual order the routes are created in, in RouteCollection, ensures proper route resolution
155+
152156
You would not have routes for `photos` for both a resource and a presenter
153157
controller. You need to distinguish them, for instance::
154158

0 commit comments

Comments
 (0)