Prev | Current Page 52 | Next

Rob Allen, Nick Lo, and Steven Brown

"Zend Framework in Action"

This can be very useful
when using front controller plugins as they could alter the output of the action before it is sent back to the
client.
Zend_Controller_Response_Http contains three types of information: header, body and exception. In the
context of the response, the headers are HTTP headers, not HTML headers. Each header is an array containing
a name along with its value and it is possible to have two header with the same name but different values
within the response??™s container. The response also holds the HTTP response code (as defined in RFC 2616)
which is sent to the client at the end of processing. By default, this is set to 200 which mean OK. Other
common response codes are 404 (Not Found) and 302 (Found) which is used when redirecting to a new URL.
As we will see later, the use of status code 304 (Not Modified) can be very useful when responding to requests
for RSS feeds as it can save considerable bandwidth.
The body container within the response is used to contain everything else that needs to be sent back to the
client. For a web application this means everything you see when you view source on a web page. If you are
sending a file to a client, then the body would contain the contents of the file. For example, to send a pdf file to
the client, the following code would be used:
$filename = 'example.


Pages:
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
Powermed 2 1 Paula Atherton bet365 brak