From c1fa07415179d63762f1a22f0f74660a8034707f Mon Sep 17 00:00:00 2001
From: admin
passed to your function will be the re-routed ones.
Code Igniter can be told to load a default controller when a URI is not present, +as will be the case when only your site root URL is requested. To specify a default controller, open +your application/config/routes.php file and set this variable:
+ +$route['default_controller'] = 'Blog';
+
+Where Blog is the name of the controller class you want used. If you now load your main index.php file without +specifying any URI segments you'll see your Hello World message by default.
+ +Code Igniter has an output class that takes care of sending your final rendered data to the web browser automatically. More information on this can be found in the +Views and Output class pages. In some cases, however, you might want to control +how the output gets sent to the browser, or you might want to post process the finalized data in some way. Code Igniter permits you to +add a function named _output() to your controller that will receive the finalized output data. + +
Important: If your controller contains a function named _output(), it will always +be called by the output class instead of echoing the finalized data directly. The first parameter of the function will contain the finalized output.
+ +Here is an example:
+ +
+function _output($output)
+{
+ echo $output;
+}
+
+Please note that your _output() function will receive the data in its finalized form - including rendered benchmark and memory usage data, +so if you are using this feature the page execution timer might not be perfectly accurate.
+In some cases you may want certain functions hidden from public access. To make a function private, simply add an underscore as the name prefix and it will not be served via a URL request. For example, if you were to have a function like this:
@@ -255,19 +293,6 @@ function _utility()Code Igniter can be told to load a default controller when a URI is not present, -as will be the case when only your site root URL is requested. To specify a default controller, open -your application/config/routes.php file and set this variable:
- -$route['default_controller'] = 'Blog';
-
-Where Blog is the name of the controller class you want used. If you now load your main index.php file without -specifying any URI segments you'll see your Hello World message by default.
- -