@@ -740,21 +740,22 @@ See :ref:`Auto Routing in Controllers <controller-auto-routing-improved>` for mo
740740Configuration Options
741741=====================
742742
743- These options are available at the top of **app/Config/Routes .php **.
743+ These options are available at the top of **app/Config/Routing .php **.
744744
745745Default Controller
746746------------------
747747
748748For Site Root URI
749749^^^^^^^^^^^^^^^^^
750750
751- When a user visits the root of your site (i.e., **example.com **) the controller to use is determined by the value set by
752- the ``setDefaultController() `` method, unless a route exists for it explicitly.
751+ When a user visits the root of your site (i.e., **example.com **) the controller
752+ to use is determined by the value set to the ``$defaultController `` property,
753+ unless a route exists for it explicitly.
753754
754- The default value for this is ``Home ``
755- which matches the controller at **app/Controllers/Home.php **:
755+ The default value for this is ``Home `` which matches the controller at
756+ **app/Controllers/Home.php **: :
756757
757- .. literalinclude :: routing/047.php
758+ public string $defaultController = 'Home';
758759
759760For Directory URI
760761^^^^^^^^^^^^^^^^^
@@ -775,10 +776,10 @@ This works similar to the default controller setting, but is used to determine t
775776when a controller is found that matches the URI, but no segment exists for the method. The default value is
776777``index ``.
777778
778- In this example, if the user were to visit **example.com/products **, and a ``Products `` controller existed, the
779- ``Products::getListAll() `` method would be executed:
779+ In this example, if the user were to visit **example.com/products **, and a ``Products ``
780+ controller existed, the ``Products::getListAll() `` method would be executed: :
780781
781- .. literalinclude :: routing/048.php
782+ public string $defaultMethod = 'listAll';
782783
783784.. important :: You cannot access the controller with the URI of the default method name.
784785 In the example above, you can access **example.com/products **, but if you access **example.com/products/listall **, it will be not found.
@@ -868,19 +869,22 @@ See :ref:`Auto Routing (Legacy) in Controllers <controller-auto-routing-legacy>`
868869Configuration Options (Legacy)
869870==============================
870871
871- These options are available at the top of **app/Config/Routes .php **.
872+ These options are available at the top of **app/Config/Routing .php **.
872873
873874Default Controller (Legacy)
874875---------------------------
875876
876877For Site Root URI (Legacy)
877878^^^^^^^^^^^^^^^^^^^^^^^^^^
878879
879- When a user visits the root of your site (i.e., example.com) the controller to use is determined by the value set by
880- the `` setDefaultController() `` method, unless a route exists for it explicitly. The default value for this is ``Home ``
881- which matches the controller at ** app/Controllers/Home.php **:
880+ When a user visits the root of your site (i.e., ** example.com ** ) the controller
881+ to use is determined by the value set to the ``$defaultController `` property,
882+ unless a route exists for it explicitly.
882883
883- .. literalinclude :: routing/047.php
884+ The default value for this is ``Home `` which matches the controller at
885+ **app/Controllers/Home.php **::
886+
887+ public string $defaultController = 'Home';
884888
885889For Directory URI (Legacy)
886890^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -898,10 +902,10 @@ This works similar to the default controller setting, but is used to determine t
898902when a controller is found that matches the URI, but no segment exists for the method. The default value is
899903``index ``.
900904
901- In this example, if the user were to visit **example.com/products **, and a ``Products `` controller existed, the
902- ``Products::listAll() `` method would be executed:
905+ In this example, if the user were to visit **example.com/products **, and a ``Products ``
906+ controller existed, the ``Products::listAll() `` method would be executed: :
903907
904- .. literalinclude :: routing/048.php
908+ public string $defaultMethod = 'listAll';
905909
906910Confirming Routes
907911*****************
0 commit comments