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
+8-8Lines changed: 8 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ First, let's look at Defined Route Routing. If you want to use Auto Routing, see
22
22
Setting Routing Rules
23
23
*********************
24
24
25
-
Routing rules are defined in the **app/Routes.php** file. In it you'll see that
25
+
Routing rules are defined in the **app/Config/Routes.php** file. In it you'll see that
26
26
it creates an instance of the RouteCollection class (``$routes``) that permits you to specify your own routing criteria.
27
27
Routes can be specified using placeholders or Regular Expressions.
28
28
@@ -408,7 +408,7 @@ The value for the filter can be a string or an array of strings:
408
408
409
409
See :doc:`Controller Filters <filters>` for more information on setting up filters.
410
410
411
-
.. Warning:: If you set filters to routes in **app/Routes.php**
411
+
.. Warning:: If you set filters to routes in **app/Config/Routes.php**
412
412
(not in **app/Config/Filters.php**), it is recommended to disable Auto Routing (Legacy).
413
413
When :ref:`auto-routing-legacy` is enabled, it may be possible that a controller can be accessed
414
414
via a different URL than the configured route,
@@ -584,7 +584,7 @@ When no defined route is found that matches the URI, the system will attempt to
584
584
controllers and methods when Auto Routing is enabled.
585
585
586
586
You can disable this automatic matching, and restrict routes
587
-
to only those defined by you, by setting the ``$autoRoute`` option to false:
587
+
to only those defined by you, by setting the ``$autoRoute`` property to false:
588
588
589
589
.. literalinclude:: routing/050.php
590
590
@@ -600,7 +600,7 @@ a valid class/method pair, just like you would show in any route, or a Closure:
600
600
601
601
.. literalinclude:: routing/051.php
602
602
603
-
Using the ``set404Override`` method within the routes file, you can use closures. Defining the override in the Routing file is restricted to class/method pairs.
603
+
Using the ``$override404`` property within the routing config file, you can use closures. Defining the override in the Routing file is restricted to class/method pairs.
604
604
605
605
.. note:: The ``set404Override()`` method does not change the Response status code to ``404``.
606
606
If you don't set the status code in the controller you set, the default status code ``200``
@@ -677,7 +677,7 @@ See :ref:`Auto Routing in Controllers <controller-auto-routing-improved>` for mo
677
677
Configuration Options
678
678
=====================
679
679
680
-
These options are available at the top of **app/Routes.php**.
680
+
These options are available at the top of **app/Config/Routes.php**.
681
681
682
682
Default Controller
683
683
------------------
@@ -720,7 +720,7 @@ Auto Routing (Legacy)
720
720
Auto Routing (Legacy) is a routing system from CodeIgniter 3.
721
721
It can automatically route HTTP requests based on conventions and execute the corresponding controller methods.
722
722
723
-
It is recommended that all routes are defined in the **app/Routes.php** file,
723
+
It is recommended that all routes are defined in the **app/Config/Routes.php** file,
724
724
or to use :ref:`auto-routing-improved`,
725
725
726
726
.. warning:: To prevent misconfiguration and miscoding, we recommend that you do not use
@@ -734,7 +734,7 @@ Enable Auto Routing (Legacy)
734
734
735
735
Since v4.2.0, the auto-routing is disabled by default.
736
736
737
-
To use it, you need to change the setting ``setAutoRoute()`` option to true in **app/Routes.php**::
737
+
To use it, you need to change the setting ``$autoRoute`` option to true in **app/Config/Routing.php**::
738
738
739
739
$routes->setAutoRoute(true);
740
740
@@ -761,7 +761,7 @@ See :ref:`Auto Routing (Legacy) in Controllers <controller-auto-routing-legacy>`
761
761
Configuration Options (Legacy)
762
762
==============================
763
763
764
-
These options are available at the top of **app/Routes.php**.
764
+
These options are available at the top of **app/Config/Routes.php**.
Copy file name to clipboardExpand all lines: user_guide_src/source/installation/upgrade_440.rst
-1Lines changed: 0 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -68,7 +68,6 @@ Routing
68
68
To clean up the routing system, the following changes were made:
69
69
- New ``app/Config/Routing.php`` file that holds the settings that used to be in the Routes file.
70
70
- The ``app/Config/Routes.php`` file was simplified so that it only contains the routes without settings and verbiage to clutter the file.
71
-
- The ``app/Config/Routes.php`` file was moved to ``app/Routes.php`` to make it easier to find. When upgrading, you can change the ``app/Config/Routing.php` file, ``$routeFiles`` property to point to the old location if you prefer.
72
71
- The environment-specific routes files are no longer loaded automatically. To load those, you must add them to the ``$routeFiles`` property in ``app/Config/Routing.php``.
0 commit comments