PHP Class CI_Output, TastyIgniter

Responsible for sending final output to browser
显示文件 Open project: tastyigniter/tastyigniter Class Usage Examples

Public Properties

Property Type Description
$cache_expiration integer Cache expiration time
$enable_profiler boolean Enable Profiler flag
$final_output string Final output string
$headers array List of server headers
$mimes array List of mime types
$parse_exec_vars boolean Whether or not to parse variables like {elapsed_time} and {memory_usage}.

Protected Properties

Property Type Description
$_compress_output boolean CI output compression flag
$_profiler_sections array List of profiler sections
$_zlib_oc boolean php.ini zlib.output_compression flag
$mime_type string Mime-type for the current page

Public Methods

Method Description
__construct ( ) : void Class constructor
_display ( string $output = '' ) : void Display Output
_display_cache ( &$CFG, &$URI ) : boolean Update/serve cached output
_write_cache ( string $output ) : void Write Cache
append_output ( string $output ) : CI_Output Append Output
cache ( integer $time ) : CI_Output Set Cache
delete_cache ( string $uri = '' ) : boolean Delete cache
enable_profiler ( boolean $val = TRUE ) : CI_Output Enable/disable Profiler
get_content_type ( ) : string Get Current Content-Type Header
get_header ( $header ) : string Get Header
get_output ( ) : string Get Output
set_cache_header ( integer $last_modified, integer $expiration ) : void Set Cache Header
set_content_type ( string $mime_type, string $charset = NULL ) : CI_Output Set Content-Type Header
set_header ( string $header, boolean $replace = TRUE ) : CI_Output Set Header
set_output ( string $output ) : CI_Output Set Output
set_profiler_sections ( array $sections ) : CI_Output Set Profiler Sections
set_status_header ( integer $code = 200, string $text = '' ) : CI_Output Set HTTP Status Header

Method Details

__construct() public method

Determines whether zLib output compression will be used.
public __construct ( ) : void
return void

_display() public method

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.
public _display ( string $output = '' ) : void
$output string Output data override
return void

_display_cache() public method

Update/serve cached output
public _display_cache ( &$CFG, &$URI ) : boolean
return boolean TRUE on success or FALSE on failure

_write_cache() public method

Write Cache
public _write_cache ( string $output ) : void
$output string Output data to cache
return void

append_output() public method

Appends data onto the output string.
public append_output ( string $output ) : CI_Output
$output string Data to append
return CI_Output

cache() public method

Set Cache
public cache ( integer $time ) : CI_Output
$time integer Cache expiration time in minutes
return CI_Output

delete_cache() public method

Delete cache
public delete_cache ( string $uri = '' ) : boolean
$uri string URI string
return boolean

enable_profiler() public method

Enable/disable Profiler
public enable_profiler ( boolean $val = TRUE ) : CI_Output
$val boolean TRUE to enable or FALSE to disable
return CI_Output

get_content_type() public method

Get Current Content-Type Header
public get_content_type ( ) : string
return string 'text/html', if not already set

get_header() public method

Get Header
public get_header ( $header ) : string
return string

get_output() public method

Returns the current output string.
public get_output ( ) : string
return string

set_cache_header() public method

Set the HTTP headers to match the server-side file cache settings in order to reduce bandwidth.
public set_cache_header ( integer $last_modified, integer $expiration ) : void
$last_modified integer Timestamp of when the page was last modified
$expiration integer Timestamp of when should the requested page expire from cache
return void

set_content_type() public method

Set Content-Type Header
public set_content_type ( string $mime_type, string $charset = NULL ) : CI_Output
$mime_type string Extension of the file we're outputting
$charset string Character set (default: NULL)
return CI_Output

set_header() public method

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.
public set_header ( string $header, boolean $replace = TRUE ) : CI_Output
$header string Header
$replace boolean Whether to replace the old header value, if already set
return CI_Output

set_output() public method

Sets the output string.
public set_output ( string $output ) : CI_Output
$output string Output data
return CI_Output

set_profiler_sections() public method

Allows override of default/config settings for Profiler section display.
public set_profiler_sections ( array $sections ) : CI_Output
$sections array Profiler sections
return CI_Output

set_status_header() public method

As of version 1.7.2, this is an alias for common function set_status_header().
public set_status_header ( integer $code = 200, string $text = '' ) : CI_Output
$code integer Status code (default: 200)
$text string Optional message
return CI_Output

Property Details

$_compress_output protected_oe property

CI output compression flag
protected bool $_compress_output
return boolean

$_profiler_sections protected_oe property

List of profiler sections
protected array $_profiler_sections
return array

$_zlib_oc protected_oe property

php.ini zlib.output_compression flag
protected bool $_zlib_oc
return boolean

$cache_expiration public_oe property

Cache expiration time
public int $cache_expiration
return integer

$enable_profiler public_oe property

Enable Profiler flag
public bool $enable_profiler
return boolean

$final_output public_oe property

Final output string
public string $final_output
return string

$headers public_oe property

List of server headers
public array $headers
return array

$mime_type protected_oe property

Mime-type for the current page
protected string $mime_type
return string

$mimes public_oe property

List of mime types
public array $mimes
return array

$parse_exec_vars public_oe property

Whether or not to parse variables like {elapsed_time} and {memory_usage}.
public bool $parse_exec_vars
return boolean