Class Request

Description

Provides HTTP request information such as headers, query parameters etc.

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

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


	
			
Method Summary
static Request getInstance ()
mixed getAttribute (string $name)
string getHeader (string $name)
string getMethod ()
string getParameter (string $name)
array getParameterMap ()
string getPathInfo ()
string getRequestURI ()
void setAttribute (string $name, string $value)
Methods
static method getInstance (line 123)

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

  • access: public
static Request getInstance ()
getAttribute (line 42)

Returns a request attribute, or null if it does not exist. They are used to save and share data between components in a context of a single request.

  • return: Attribute
  • access: public
mixed getAttribute (string $name)
  • string $name: Name of the attribute
getHeader (line 100)

Returns a HTTP request header, or null if it does not exist.

Header names are the same as in PHP's $_SERVER[].

  • return: Value of the header
  • access: public
string getHeader (string $name)
  • string $name: Name of the header
getMethod (line 87)

Returns a HTTP method (GET/POST/PUT/DELETE etc.) of this request.

  • return: Request method
  • access: public
string getMethod ()
getParameter (line 65)

Returns a HTTP request parameter (from both GET and POST) as a string, or null if it does not exist.

  • return: Value of the parameter
  • access: public
string getParameter (string $name)
  • string $name: Name of the parameter
getParameterMap (line 134)

Returns a map (array with keys) of parameters of this Request.

  • access: public
array getParameterMap ()
getPathInfo (line 145)

Returns Returns any extra path information associated with the URL the client sent when it made this request. The extra path information follows the servlet path but precedes the query string. This method returns null if there was no extra path information.

Same as the value of the CGI variable PATH_INFO.

  • access: public
string getPathInfo ()
getRequestURI (line 156)

Returns the part of this request's URL from the protocol name up to the query string in the first line of the HTTP request.

Same as the value of the CGI variable REQUEST_URI.

  • access: public
string getRequestURI ()
getSession (line 112)

Returns the current Session object associated with this Request.

  • return: Session
  • access: public
Session getSession ()
setAttribute (line 54)

Sets a request attribute. They are used to save and share data between components in a context of a single request.

  • access: public
void setAttribute (string $name, string $value)
  • string $name: Name of the attribute
  • string $value: Value of the attribute

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