Class flResponse
flResponse Class
Class to provide responses to requests.
Package: fusionLib
Copyright:
Copyright (c) 2008 - 2013 fusionLib. All rights reserved.
Located at system/libs/Response/flResponse.php
Methods summary
public
|
#
__construct( )
Construct the response object.
Construct the response object.
|
public
flResponse
|
#
compressOutput( boolean $enable )
Flags if output should be compressed when sending to the browser.
Flags if output should be compressed when sending to the browser.
Parameters
- $enable
- true to compress output.
Returns
|
public
flResponse
|
#
setStatusCode( integer $code )
Set the status code to return.
Set the status code to return.
Parameters
- $code
- The HTTP status code to return.
Returns
|
public
flResponse
|
#
setContentType( string $type )
Set the content type.
Parameters
- $type
- The content type or null to not send.
Returns
|
public
flResponse
|
#
setCharset( string $charset )
Set the charset.
Parameters
- $charset
- The charset or null to not send.
Returns
|
public
flResponse
|
#
noCache( boolean $cacheDisable = true )
Flag to send headers to disable caching.
Flag to send headers to disable caching.
Parameters
- $cacheDisable
- true to disable caching or false to allow caching.
Returns
|
public
flResponse
|
#
setCookie( string $name, string $value, integer $expire = 0, string $domain = '', string $path = '/', boolean $secure = false, boolean $httpOnly = false )
Set a cookie.
Parameters
- $name
- The name of the cookie.
- $value
- The value to set.
- $expire
The number of seconds until the cookie expires, 0 if the cookie
should expire at the end of the session, negative value to delete cookie.
- $domain
- The domain to set the cookie on.
- $path
- The path for the cookie.
- $secure
- Flags if the cookie should be available over https only.
- $httpOnly
- Flags if the cookie is only available via http protocol, true.
Returns
|
public
|
#
redirectTo( string $uri, boolean $permanent = false )
Issue a redirect header to the browser, this function never returns.
Issue a redirect header to the browser, this function never returns.
Parameters
- $uri
- The absolute URI to redirect to.
- $permanent
- Flags if to issue a temporary, 302, move (false) or a permanent 301 move (true).
|
public
flResponse
|
#
setLastModified( integer $timestamp )
Set the last modified date and time header.
Set the last modified date and time header.
If the request contains an If-Modified-Since header with a matching time stamp then
304 Not Modified is returned and the application exits.
Parameters
- $timestamp
- The Unix timestamp when the page was last modified.
Returns
See
http://www.zend.com/zend/spotlight/dynamic-pages.php?article=dynamic-pages&id=990
|
public
flResponse
|
#
setBody( string $content )
Set the body content.
Parameters
- $content
- The content to set.
Returns
|
public
|
#
sendResponse( )
Send the response to the browser.
Send the response to the browser.
|