Skip to content

Commit cd523c7

Browse files
authored
Merge pull request #5410 from kenjis/fix-docs-upgrade_routing.rst
docs: fix upgrade_routing.rst
2 parents 91a0af2 + bed9e5c commit cd523c7

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

user_guide_src/source/installation/upgrade_routing.rst

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,18 @@ What has been changed
1919

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

24-
- ``$route['journals'] = 'blogs';`` to ``$routes->add('journals', 'App\Blogs');`` this would map to the ``index()`` method in the "Blogs" class.
25-
- ``$route['product/(:any)'] = 'catalog/product_lookup';`` to ``$routes->add('product/(:any)', 'Catalog::productLookup');``
26-
- ``$route['login/(.+)'] = 'auth/login/$1';`` to ``$routes->add('login/(.+)', 'Auth::login/$1');``
24+
- ``$route['journals'] = 'blogs';`` to ``$routes->add('journals', 'Blogs::index');``. This would map to the ``index()`` method in the ``Blogs`` controller.
25+
- ``$route['product/(:any)'] = 'catalog/product_lookup';`` to ``$routes->add('product/(:any)', 'Catalog::productLookup');``
26+
- ``$route['login/(.+)'] = 'auth/login/$1';`` to ``$routes->add('login/(.+)', 'Auth::login/$1');``
2727

2828
Code Example
2929
============
3030

3131
CodeIgniter Version 3.11
3232
------------------------
33-
Path: ``application/config/routes.php``::
33+
Path: **application/config/routes.php**::
3434

3535
<?php
3636
defined('BASEPATH') OR exit('No direct script access allowed');
@@ -47,7 +47,7 @@ Path: ``application/config/routes.php``::
4747

4848
CodeIgniter Version 4.x
4949
-----------------------
50-
Path: ``app/Config/Routes.php``::
50+
Path: **app/Config/Routes.php**::
5151

5252
<?php
5353

@@ -64,12 +64,12 @@ Path: ``app/Config/Routes.php``::
6464

6565
...
6666

67-
$routes->add('posts', 'Posts::index');
67+
$routes->add('posts/index', 'Posts::index');
6868
$routes->add('teams/create', 'Teams::create');
69-
$routes->add('teams/edit/(:any)', 'Teams::edit/$1');
69+
$routes->add('teams/update', 'Teams::update');
7070

7171
$routes->add('posts/create', 'Posts::create');
72-
$routes->add('posts/edit/(:any)', 'Posts::edit/$1');
72+
$routes->add('posts/update', 'Posts::update');
7373
$routes->add('drivers/create', 'Drivers::create');
74-
$routes->add('drivers/edit/(:any)', 'Drivers::edit/$1');
74+
$routes->add('drivers/update', 'Drivers::update');
7575
$routes->add('posts/(:any)', 'Posts::view/$1');

0 commit comments

Comments
 (0)