CodeIgniter Forums
Routing – error in tutorial? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Development (https://forum.codeigniter.com/forumdisplay.php?fid=6)
+--- Forum: Issues (https://forum.codeigniter.com/forumdisplay.php?fid=19)
+--- Thread: Routing – error in tutorial? (/showthread.php?tid=67437)



Routing – error in tutorial? - gerald - 02-22-2017

https://www.codeigniter.com/user_guide/general/routing.html
On this page you can read:
Quote:Important
The reserved routes must come before any wildcard or regular expression routes.

https://www.codeigniter.com/user_guide/tutorial/news_section.html
On this tutorial page you have this example:
Code:
$route['news/(:any)'] = 'news/view/$1';
$route['news'] = 'news';
$route['(:any)'] = 'pages/view/$1';
$route['default_controller'] = 'pages/view';


$route['default_controller'] is a reserved route if I understand the documentation correctly.

Regards
Gerald


RE: Routing – error in tutorial? - gerald - 03-07-2017

I'm sure there are some routing experts around. It would be great if someone could look at this.

For beginners in working with CI the tutorial is very important.

Thank you!


RE: Routing – error in tutorial? - Code4fun - 03-07-2017

(03-07-2017, 04:38 AM)gerald Wrote: I'm sure there are some routing experts around. It would be great if someone could look at this.

For beginners in working with CI the tutorial is very important.

Thank you!

This one?


RE: Routing – error in tutorial? - InsiteFX - 03-07-2017

Routes with (:any) should all be placed at the bottom of all routes it is a catch all route.


RE: Routing – error in tutorial? - Narf - 03-07-2017

(02-22-2017, 01:57 PM)gerald Wrote: https://www.codeigniter.com/user_guide/general/routing.html
On this page you can read:
Quote:Important
The reserved routes must come before any wildcard or regular expression routes.

The note is wrong ... it's likely from older times and we forgot to remove it.


RE: Routing – error in tutorial? - gerald - 03-08-2017

Thank you Narf!

Generally speaking I suggest to keep tutorials für newbies as simple as possible.

Maybe someone doesn't need wildcard or regular expression routes while trying the first steps with CI.