Welcome Guest, Not a member yet? Register   Sign In
Routing – error in tutorial?
#1

(This post was last modified: 03-08-2017, 06:32 AM by gerald. Edit Reason: Hopefully easier to understand )

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, 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?
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 CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#5

(02-22-2017, 01: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




Theme © iAndrew 2016 - Forum software by © MyBB