Welcome Guest, Not a member yet? Register   Sign In
"Router" in the Application Flow Chart
#1

[eluser]Unknown[/eluser]
The Application Flow Chart (http://ellislab.com/codeigniter/user-gui...pflow.html) states that "The Router examines the HTTP request to determine what should be done with it" but I would like to know what this Router is. By examine the source code, it seems to be the Router.php-file in the system->core-directory but I've been unable to find any information that verifies this.

Also, is there any documentation about this file more than the comments in the source code? Google turned me down.
#2

[eluser]WanWizard[/eluser]
The router class is configured through config/routes.php. You will find the howto here: http://ellislab.com/codeigniter/user-gui...uting.html
#3

[eluser]pickupman[/eluser]
Yes you are looking at the correct file. The Router file will first check if a cached html page is fresh, serve it to the browser without any further processing. Typically, with most sites nowadays a full page cache is not very practical because log in and out of sites. Then Router class parses the URI and loads the defined routes from application/config/routes.php. If a pattern match is found, CI will load the appropriate controller/method. If no pattern is found, is will look to see if a controller can be found in application/controllers, and then application/subfolder_name/subfolder_name.php. Once a match is found it runs the appropriate method. If no match has been found it will call your 404 route defined in application/config/routes.php. If that isn't found the function show_404() is called.
#4

[eluser]InsiteFX[/eluser]
I have updated the appflow image for CI 2.0 and it is in the Reactor so new release's should have the correct one!

InsiteFX




Theme © iAndrew 2016 - Forum software by © MyBB