Skip to content

Commit 291a4bf

Browse files
committed
docs: add sub section titles
1 parent 84a6c51 commit 291a4bf

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

user_guide_src/source/incoming/routing.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,19 +269,28 @@ extensive set of routes that all share the opening string, like when building an
269269

270270
This would prefix the **users** and **blog** URIs with **admin**, handling URLs like **admin/users** and **admin/blog**.
271271

272+
Setting Namespace
273+
-----------------
274+
272275
If you need to assign options to a group, like a :ref:`assigning-namespace`, do it before the callback:
273276

274277
.. literalinclude:: routing/024.php
275278

276279
This would handle a resource route to the ``App\API\v1\Users`` controller with the **api/users** URI.
277280

281+
Setting Filters
282+
---------------
283+
278284
You can also use a specific :doc:`filter <filters>` for a group of routes. This will always
279285
run the filter before or after the controller. This is especially handy during authentication or api logging:
280286

281287
.. literalinclude:: routing/025.php
282288

283289
The value for the filter must match one of the aliases defined within **app/Config/Filters.php**.
284290

291+
Nesting Groups
292+
--------------
293+
285294
It is possible to nest groups within groups for finer organization if you need it:
286295

287296
.. literalinclude:: routing/026.php
@@ -290,6 +299,9 @@ This would handle the URL at **admin/users/list**.
290299

291300
.. note:: Options passed to the outer ``group()`` (for example ``namespace`` and ``filter``) are not merged with the inner ``group()`` options.
292301

302+
Setting Other Options
303+
---------------------
304+
293305
At some point, you may want to group routes for the purpose of applying filters or other route
294306
config options like namespace, subdomain, etc. Without necessarily needing to add a prefix to the group, you can pass
295307
an empty string in place of the prefix and the routes in the group will be routed as though the group never existed but with the

0 commit comments

Comments
 (0)