You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: user_guide_src/source/incoming/routing.rst
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -319,7 +319,7 @@ available from the command line:
319
319
See the :doc:`../cli/spark_commands` page for detailed information.
320
320
321
321
Global Options
322
-
==============
322
+
**************
323
323
324
324
All of the methods for creating a route (``get()``, ``post()``, :doc:`resource() <restful>` etc) can take an array of options that
325
325
can modify the generated routes, or further restrict them. The ``$options`` array is always the last parameter:
@@ -329,7 +329,7 @@ can modify the generated routes, or further restrict them. The ``$options`` arra
329
329
.. _applying-filters:
330
330
331
331
Applying Filters
332
-
----------------
332
+
================
333
333
334
334
You can alter the behavior of specific routes by supplying filters to run before or after the controller. This is especially handy during authentication or api logging.
335
335
The value for the filter can be a string or an array of strings:
@@ -347,7 +347,7 @@ See :doc:`Controller filters <filters>` for more information on setting up filte
347
347
See :ref:`use-defined-routes-only` to disable auto-routing.
348
348
349
349
Alias Filter
350
-
^^^^^^^^^^^^
350
+
------------
351
351
352
352
You specify an alias defined in **app/Config/Filters.php** for the filter value:
353
353
@@ -358,7 +358,7 @@ You may also supply arguments to be passed to the alias filter's ``before()`` an
358
358
.. literalinclude:: routing/035.php
359
359
360
360
Classname Filter
361
-
^^^^^^^^^^^^^^^^
361
+
----------------
362
362
363
363
.. versionadded:: 4.1.5
364
364
@@ -367,7 +367,7 @@ You specify a filter classname for the filter value:
367
367
.. literalinclude:: routing/036.php
368
368
369
369
Multiple Filters
370
-
^^^^^^^^^^^^^^^^
370
+
----------------
371
371
372
372
.. versionadded:: 4.1.5
373
373
@@ -380,7 +380,7 @@ You specify an array for the filter value:
380
380
.. _assigning-namespace:
381
381
382
382
Assigning Namespace
383
-
-------------------
383
+
===================
384
384
385
385
While a :ref:`routing-default-namespace` will be prepended to the generated controllers, you can also specify
386
386
a different namespace to be used in any options array, with the ``namespace`` option. The value should be the
@@ -393,7 +393,7 @@ For any methods that create multiple routes, the new namespace is attached to al
393
393
or, in the case of ``group()``, all routes generated while in the closure.
394
394
395
395
Limit to Hostname
396
-
-----------------
396
+
=================
397
397
398
398
You can restrict groups of routes to function only in certain domain or sub-domains of your application
399
399
by passing the "hostname" option along with the desired domain to allow it on as part of the options array:
@@ -404,7 +404,7 @@ This example would only allow the specified hosts to work if the domain exactly
404
404
It would not work under the main site at **example.com**.
405
405
406
406
Limit to Subdomains
407
-
-------------------
407
+
===================
408
408
409
409
When the ``subdomain`` option is present, the system will restrict the routes to only be available on that
410
410
sub-domain. The route will only be matched if the subdomain is the one the application is being viewed through:
@@ -421,7 +421,7 @@ that does not have any subdomain present, this will not be matched:
421
421
to separate suffixes or www) can potentially lead to false positives.
422
422
423
423
Offsetting the Matched Parameters
424
-
---------------------------------
424
+
=================================
425
425
426
426
You can offset the matched parameters in your route by any numeric value with the ``offset`` option, with the
0 commit comments