• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Routing – error in tutorial?

#1
https://www.codeigniter.com/user_guide/g...uting.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/t...ction.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
Reply

#2
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!
Reply

#3
(03-07-2017, 05: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?
Reply

#4
Routes with (:any) should all be placed at the bottom of all routes it is a catch all route.
What did you Try? What did you Get? What did you Expect?

Joined the CodeIgniter Community in 2009.          ( Skype: insitfx )
Reply

#5
(02-22-2017, 02:57 PM)gerald Wrote: https://www.codeigniter.com/user_guide/g...uting.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.
Reply

#6
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.
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2017 MyBB Group.