Class Response

Description

Provides access to HTTP response, such as status, headers etc.

Wraps PHP's functions and global arrays to emulate Java's HttpServletResponse interface. That means it can only be used to represent the "current" response.

Located in /diy-framework/controller/Response.class.php (line 12)


	
			
Class Constant Summary
Method Summary
static Response getInstance ()
string getBuffer ()
string getContentType ()
int getStatus ()
void sendRedirect (string $url)
void setCharacterEncoding (string $encoding)
void setContentType (string $contentType)
void setHeader (string $name, string $value)
void setStatus (int $status)
void write (string $string)
Methods
static method getInstance (line 52)

Returns instance of self (Response object). Used to implement Singleton pattern.

  • access: public
static Response getInstance ()
getBuffer (line 145)

Returns the whole response output buffer.

  • return: Buffer string
  • access: public
string getBuffer ()
getCharacterEncoding (line 104)

Returns character encoding.

  • return: Character encoding
  • access: public
string getCharacterEncoding ()
getContentType (line 83)

Returns content type.

  • return: Content type
  • access: public
string getContentType ()
getStatus (line 63)

Returns response status.

  • return: Status code
  • access: public
int getStatus ()
sendRedirect (line 124)

Sends a temporary redirect response to the client using the specified redirect location URL.

  • access: public
void sendRedirect (string $url)
  • string $url: Redirect location URL
setCharacterEncoding (line 114)

Sets character encoding (e.g. "UTF-8").

  • access: public
void setCharacterEncoding (string $encoding)
  • string $encoding: Character encoding
setContentType (line 93)

Sets content type (e.g. "text/html").

  • access: public
void setContentType (string $contentType)
  • string $contentType: Content type
setHeader (line 41)

Sets a HTTP response header.

  • access: public
void setHeader (string $name, string $value)
  • string $name: Name of the header
  • string $value: Value of the header
setStatus (line 73)

Sets response status.

  • access: public
void setStatus (int $status)
  • int $status: Status code
write (line 135)

Writes a string into the response output buffer.

  • access: public
void write (string $string)
  • string $string: String
Class Constants
SC_FORBIDDEN = 403 (line 22)
SC_INTERNAL_SERVER_ERROR = 500 (line 25)
SC_METHOD_NOT_ALLOWED = 405 (line 24)
SC_NOT_FOUND = 404 (line 23)
SC_OK = 200 (line 21)

Documentation generated on Tue, 25 Sep 2007 11:17:23 +0200 by phpDocumentor 1.3.2