-
Notifications
You must be signed in to change notification settings - Fork 0
CI_Output
Output Class
Responsible for sending final output to the browser.
- Class name: CI_Output
- Namespace:
public string $final_output
Final output string
- Visibility: public
public integer $cache_expiration
Cache expiration time
- Visibility: public
public array $headers = array()
List of server headers
- Visibility: public
public array $mimes = array()
List of mime types
- Visibility: public
protected string $mime_type = 'text/html'
Mime-type for the current page
- Visibility: protected
public boolean $enable_profiler = FALSE
Enable Profiler flag
- Visibility: public
protected boolean $_zlib_oc = FALSE
php.ini zlib.output_compression flag
- Visibility: protected
protected boolean $_compress_output = FALSE
CI output compression flag
- Visibility: protected
protected array $_profiler_sections = array()
List of profiler sections
- Visibility: protected
public boolean $parse_exec_vars = TRUE
Parse markers flag
Whether or not to parse variables like {elapsed_time} and {memory_usage}.
- Visibility: public
void CI_Output::__construct()
Class constructor
Determines whether zLib output compression will be used.
- Visibility: public
string CI_Output::get_output()
Get Output
Returns the current output string.
- Visibility: public
\CI_Output CI_Output::set_output(string $output)
Set Output
Sets the output string.
- Visibility: public
- $output string - <p>Output data</p>
\CI_Output CI_Output::append_output(string $output)
Append Output
Appends data onto the output string.
- Visibility: public
- $output string - <p>Data to append</p>
\CI_Output CI_Output::set_header(string $header, boolean $replace)
Set Header
Lets you set a server header which will be sent with the final output.
Note: If a file is cached, headers will not be sent.
- Visibility: public
- $header string - <p>Header</p>
- $replace boolean - <p>Whether to replace the old header value, if already set</p>
\CI_Output CI_Output::set_content_type(string $mime_type, string $charset)
Set Content-Type Header
- Visibility: public
- $mime_type string - <p>Extension of the file we're outputting</p>
- $charset string - <p>Character set (default: NULL)</p>
string CI_Output::get_content_type()
Get Current Content-Type Header
- Visibility: public
string CI_Output::get_header($header)
Get Header
- Visibility: public
- $header mixed
\CI_Output CI_Output::set_status_header(integer $code, string $text)
Set HTTP Status Header
As of version 1.7.2, this is an alias for common function set_status_header().
- Visibility: public
- $code integer - <p>Status code (default: 200)</p>
- $text string - <p>Optional message</p>
\CI_Output CI_Output::enable_profiler(boolean $val)
Enable/disable Profiler
- Visibility: public
- $val boolean - <p>TRUE to enable or FALSE to disable</p>
\CI_Output CI_Output::set_profiler_sections(array $sections)
Set Profiler Sections
Allows override of default/config settings for Profiler section display.
- Visibility: public
- $sections array - <p>Profiler sections</p>
\CI_Output CI_Output::cache(integer $time)
Set Cache
- Visibility: public
- $time integer - <p>Cache expiration time in seconds</p>
void CI_Output::_display(string $output)
Display Output
Processes and sends finalized output data to the browser along with any server headers and profile data. It also stops benchmark timers so the page rendering speed and memory usage can be shown.
Note: All "view" data is automatically put into $this->final_output by controller class.
- Visibility: public
- $output string - <p>Output data override</p>
void CI_Output::_write_cache(string $output)
Write Cache
- Visibility: public
- $output string - <p>Output data to cache</p>
boolean CI_Output::_display_cache($CFG, $URI)
Update/serve cached output
- Visibility: public
- $CFG mixed
- $URI mixed
boolean CI_Output::delete_cache(string $uri)
Delete cache
- Visibility: public
- $uri string - <p>URI string</p>
void CI_Output::set_cache_header(integer $last_modified, integer $expiration)
Set Cache Header
Set the HTTP headers to match the server-side file cache settings in order to reduce bandwidth.
- Visibility: public
- $last_modified integer - <p>Timestamp of when the page was last modified</p>
- $expiration integer - <p>Timestamp of when should the requested page expire from cache</p>