Skip to content

Commit 6d462d2

Browse files
authored
Shifted basic URI Routing example down
1 parent b4bc1b4 commit 6d462d2

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

user_guide_src/source/incoming/routing.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,27 +73,27 @@ The following placeholders are available for you to use in your routes:
7373
Examples
7474
========
7575

76-
Here are a few basic routing examples::
77-
78-
$routes->add('journals', 'App\Blogs');
76+
Here are a few basic routing examples.
7977

8078
A URL containing the word "journals" in the first segment will be remapped to the "App\Blogs" class,
8179
and the default method, which is usually ``index()``::
8280

83-
$routes->add('blog/joe', 'Blogs::users/34');
81+
$routes->add('journals', 'App\Blogs');
8482

8583
A URL containing the segments "blog/joe" will be remapped to the “\Blogs” class and the “users” method.
8684
The ID will be set to “34”::
8785

88-
$routes->add('product/(:any)', 'Catalog::productLookup');
86+
$routes->add('blog/joe', 'Blogs::users/34');
8987

9088
A URL with “product” as the first segment, and anything in the second will be remapped to the “\Catalog” class
9189
and the “productLookup” method::
9290

93-
$routes->add('product/(:num)', 'Catalog::productLookupByID/$1';
91+
$routes->add('product/(:any)', 'Catalog::productLookup');
9492

9593
A URL with “product” as the first segment, and a number in the second will be remapped to the “\Catalog” class
96-
and the “productLookupByID” method passing in the match as a variable to the method.
94+
and the “productLookupByID” method passing in the match as a variable to the method::
95+
96+
$routes->add('product/(:num)', 'Catalog::productLookupByID/$1';
9797

9898
.. important:: While the ``add()`` method is convenient, it is recommended to always use the HTTP-verb-based
9999
routes, described below, as it is more secure. It will also provide a slight performance increase, since

0 commit comments

Comments
 (0)