From baa581846cbf04b0c225cbb21b0f6138ff805d79 Mon Sep 17 00:00:00 2001
From: admin
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 +Views and Output class pages. In some cases, however, you might want to +post-process the finalized data in some way and send it to the browser yourself. 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 +
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:
@@ -271,8 +271,11 @@ function _output($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.
+Please note that your _output() function will receive the data in its finalized state. Benchmark and memory usage data will be rendered, +cache files written (if you have caching enabled), and headers will be sent (if you use that feature) +before it is handed off to the _output() function. If you are using this feature the page execution timer and memory usage stats might not be perfectly accurate +since they will not take into acccount any further processing you do. For an alternate way to control output before any of the final processing is done, please see +the available methods in the Output Class.