Skip to content

docs: update "Upgrading from 3.x to 4.x" Routing for v4.2 #6074

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions user_guide_src/source/installation/upgrade_4xx.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ Application Structure
- There is no longer a nested **application/core** folder, as we have
a different mechanism for extending framework components (see below).

Routing
=======

- The Auto Routing is disabled by default. If you want to use the Auto Routing in the same way as CI3, you need to enable :ref:`auto-routing`.
- CI4 also has an optional new more secure :ref:`auto-routing-improved`.

Model, View and Controller
==========================

Expand Down
7 changes: 6 additions & 1 deletion user_guide_src/source/installation/upgrade_routing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,16 @@ Documentations

What has been changed
=====================

- In CI4 the Auto Routing is disabled by default.
- In CI4 the new more secure :ref:`auto-routing-improved` is introduced.
- In CI4 the routing is no longer configured by setting the routes as array.

Upgrade Guide
=============
1. You have to change the syntax of each routing line and append it in **app/Config/Routes.php**. For example:

1. If you use the Auto Routing in the same way as CI3, you need to enable :ref:`auto-routing`.
2. You have to change the syntax of each routing line and append it in **app/Config/Routes.php**. For example:

- ``$route['journals'] = 'blogs';`` to ``$routes->add('journals', 'Blogs::index');``. This would map to the ``index()`` method in the ``Blogs`` controller.
- ``$route['product/(:any)'] = 'catalog/product_lookup';`` to ``$routes->add('product/(:any)', 'Catalog::productLookup');``
Expand Down