Method Summary
-
addCacheControlHttpHeader($name, $value)
Adds an control cache http header.
-
addHttpMeta($key, $value, $replace)
Adds a HTTP meta header.
-
addJavascript($js, $position, $options)
Adds javascript code to the current web response.
-
addMeta($key, $value, $replace, $escape)
Adds a meta header.
-
addStylesheet($css, $position, $options)
Adds a stylesheet to the current web response.
-
addVaryHttpHeader($header)
Adds vary to a http header.
-
clearHttpHeaders()
Cleans HTTP headers from the current web response.
-
copyProperties($response)
Copies all properties from a given sfWebResponse object to the current one.
-
string
fixContentType($content)
Fixes the content type by adding the charset for text content types.
-
array
getContentType()
Gets response content type.
-
array
getCookies()
Retrieves cookies from the current web response.
-
string
getDate($timetamp, $type)
Retrieves a formated date.
-
array
getHttpHeader($name, $default)
Gets HTTP header current value.
-
string
getHttpHeaders()
Retrieves HTTP headers from the current web response.
-
string
getHttpMetas()
Retrieves meta headers for the current web response.
-
string
getJavascripts($position)
Retrieves javascript code from the current web response.
-
array
getMetas()
Retrieves all meta headers.
-
array
getPositions()
Returns the available position names for stylesheets and javascripts in order.
-
string
getSlots()
Retrieves slots from the current web response.
-
string
getStatusCode()
Retrieves status code for the current web response.
-
string
getStylesheets($position)
Retrieves stylesheets for the current web response.
-
string
getTitle()
Retrieves title for the current web response.
-
bool
hasHttpHeader($name)
Checks if response has given HTTP header.
-
bool
initialize($dispatcher, $options)
Initializes this sfWebResponse.
-
bool
isHeaderOnly()
Returns if the response must only consist of HTTP headers.
-
merge($response)
Merges all properties from a given sfWebResponse object to the current one.
-
string
normalizeHeaderName($name)
Retrieves a normalized Header.
-
removeJavascript($js, $position)
Removes javascript code from the current web response.
-
removeStylesheet($css, $position)
Removes a stylesheet from the current web response.
-
send()
Sends the HTTP headers and the content.
-
sendContent()
Send content for the current web response.
-
sendHttpHeaders()
Sends HTTP headers and cookies.
-
serialize()
@see sfResponse
-
setContentType($value)
Sets response content type.
-
setCookie($name, $value, $expire, $path, $domain, $secure, $httpOnly)
Sets a cookie.
-
setHeaderOnly($value)
Sets if the response consist of just HTTP headers.
-
setHttpHeader($name, $value, $replace)
Sets a HTTP header.
-
setSlot($name, $content)
Sets a slot content.
-
setStatusCode($code, $name)
Sets response status code.
-
setTitle($title, $escape)
Sets title for the current web response.
-
unserialize()
@see sfResponse
-
validatePosition($position)
Validate a position name.
Methods inherited from sfResponse
getContent , getOptions , initialize , send , sendContent , serialize , setContent , setEventDispatcher , unserialize , __call , __construct
Method Details
-
addCacheControlHttpHeader ($name, $value)
Browse code
| $name |
HTTP header |
| $value |
Value for the http header |
Adds an control cache http header.
-
addHttpMeta ($key, $value, $replace)
Browse code
| $key |
Key to replace |
| $value |
HTTP meta header value (if null, remove the HTTP meta) |
| $replace |
Replace or not |
Adds a HTTP meta header.
-
addJavascript ($js, $position, $options)
Browse code
| $js |
Javascript code |
| $position |
Position |
| $options |
Javascript options |
Adds javascript code to the current web response.
-
addMeta ($key, $value, $replace, $escape)
Browse code
| $key |
Name of the header |
| $value |
Meta header value (if null, remove the meta) |
| $replace |
true if it's replaceable |
| $escape |
true for escaping the header |
Adds a meta header.
-
addStylesheet ($css, $position, $options)
Browse code
| $css |
Stylesheet |
| $position |
Position |
| $options |
Stylesheet options |
Adds a stylesheet to the current web response.
-
addVaryHttpHeader ($header)
Browse code
Adds vary to a http header.
-
Cleans HTTP headers from the current web response.
-
copyProperties ($response)
Browse code
| $response |
An sfWebResponse instance |
Copies all properties from a given sfWebResponse object to the current one.
-
(string) fixContentType ($content)
Browse code
| $content |
The content type |
Fixes the content type by adding the charset for text content types.
returns The content type with the charset if needed
-
(array) getContentType ()
Browse code
Gets response content type.
-
Retrieves cookies from the current web response.
returns Cookies
-
(string) getDate ($timetamp, $type)
Browse code
| $timetamp |
Timestamp |
| $type |
Format type |
Retrieves a formated date.
returns Formatted date
-
(array) getHttpHeader ($name, $default)
Browse code
| $name |
HTTP header name |
| $default |
Default value returned if named HTTP header is not found |
Gets HTTP header current value.
-
(string) getHttpHeaders ()
Browse code
Retrieves HTTP headers from the current web response.
returns HTTP headers
-
(string) getHttpMetas ()
Browse code
Retrieves meta headers for the current web response.
returns Meta headers
-
(string) getJavascripts ($position)
Browse code
Retrieves javascript code from the current web response.
returns Javascript code
-
Retrieves all meta headers.
returns List of meta headers
-
(array) getPositions ()
Browse code
Returns the available position names for stylesheets and javascripts in order.
returns An array of position names
-
Retrieves slots from the current web response.
returns Javascript code
-
(string) getStatusCode ()
Browse code
Retrieves status code for the current web response.
returns Status code
-
(string) getStylesheets ($position)
Browse code
Retrieves stylesheets for the current web response.
returns Stylesheets
-
Retrieves title for the current web response.
returns Title
-
(bool) hasHttpHeader ($name)
Browse code
Checks if response has given HTTP header.
-
(bool) initialize ($dispatcher, $options)
Browse code
| $dispatcher |
An sfEventDispatcher instance |
| $options |
An array of options |
Initializes this sfWebResponse.
Available options: * charset: The charset to use (utf-8 by default)
* content_type: The content type (text/html by default)
* send_http_headers: Whether to send HTTP headers or not (true by default)
* http_protocol: The HTTP protocol to use for the response (HTTP/1.0 by default)
returns true, if initialization completes successfully, otherwise false
throws sfInitializationException If an error occurs while initializing this sfResponse
-
(bool) isHeaderOnly ()
Browse code
Returns if the response must only consist of HTTP headers.
returns returns true if, false otherwise
-
| $response |
An sfWebResponse instance |
Merges all properties from a given sfWebResponse object to the current one.
-
(string) normalizeHeaderName ($name)
Browse code
Retrieves a normalized Header.
returns Normalized header
-
removeJavascript ($js, $position)
Browse code
| $js |
Javascript code |
| $position |
Position |
Removes javascript code from the current web response.
-
removeStylesheet ($css, $position)
Browse code
| $css |
Stylesheet |
| $position |
Position |
Removes a stylesheet from the current web response.
-
Sends the HTTP headers and the content.
-
Send content for the current web response.
-
Sends HTTP headers and cookies.
-
@see sfResponse
-
setContentType ($value)
Browse code
Sets response content type.
-
setCookie ($name, $value, $expire, $path, $domain, $secure, $httpOnly)
Browse code
| $name |
HTTP header name |
| $value |
Value for the cookie |
| $expire |
Cookie expiration period |
| $path |
Path |
| $domain |
Domain name |
| $secure |
If secure |
| $httpOnly |
If uses only HTTP |
Sets a cookie.
throws sfException If fails to set the cookie
-
setHeaderOnly ($value)
Browse code
Sets if the response consist of just HTTP headers.
-
setHttpHeader ($name, $value, $replace)
Browse code
| $name |
HTTP header name |
| $value |
Value (if null, remove the HTTP header) |
| $replace |
Replace for the value |
Sets a HTTP header.
-
setSlot ($name, $content)
Browse code
| $name |
Slot name |
| $content |
Content |
Sets a slot content.
-
setStatusCode ($code, $name)
Browse code
| $code |
HTTP status code |
| $name |
HTTP status text |
Sets response status code.
-
setTitle ($title, $escape)
Browse code
| $title |
Title name |
| $escape |
true, for escaping the title |
Sets title for the current web response.
-
@see sfResponse
-
validatePosition ($position)
Browse code
Validate a position name.
throws InvalidArgumentException if the position is not available
|