Class myMVC_HttpRequest

Description

Manager for the request

Located in /myMVC/HttpRequest.php (line 26)


	
			
Variable Summary
 static mixed $TYPE_ACTION
 static mixed $TYPE_MENU
 static mixed $TYPE_UNKNOWN
 static mixed $TYPE_VIEW
Method Summary
 string getAction ()
 void getAllParameters ([bool $checked = true])
 string getParameter (string $key)
 string getParameterLike (string $key)
 string getQueryString ()
 string getQueryType ()
 array getQueryTypes ([string $postfix = ''])
 array getReferrer ()
 string getRequestMethod ()
 string getSubmitParameter (string $key)
 string getView ()
 boolean hasParameter (string $key)
 boolean hasParameterLike (string $key)
 boolean isEmptyRequest ()
 void setParameter (string $key, string $value)
 void setParameterValid (string $parameter)
Variables
static mixed $TYPE_ACTION = 'cmd' (line 40)

Action type (called from link)

  • access: public
static mixed $TYPE_MENU = 'menu' (line 44)

Action type (called from menu)

  • access: public
static mixed $TYPE_UNKNOWN = 'unknown' (line 36)

Unknown type. It will not be used. Just for initialize...

  • access: public
static mixed $TYPE_VIEW = 'view' (line 48)

View type

  • access: public
Methods
static getInstance (line 79)

Returns the instance of this class.

  • return: An instance of the request class
  • access: public
myMVC_HttpRequest getInstance ()
getAction (line 168)

Returns the current action or false if no action was called

  • return: The called action or false if no action was called
  • access: public
string getAction ()
getAllParameters (line 205)

Returns an associative array with all given parameters and their value (format: 'parameter' => 'value')

  • access: public
void getAllParameters ([bool $checked = true])
  • bool $checked: If true (default), then just checked parameter will be returned
getInvalidParameters (line 229)

Returns an associative array with all parameters, that passed the validation,

and their value (format: 'parameter' => 'value')

  • access: public
void getInvalidParameters ()
getParameter (line 299)

Returns the value of the given parameter

  • return: The value of the parameters or false if it doesn't exists
  • access: public
string getParameter (string $key)
  • string $key: The name of the parameter
getParameterLike (line 318)

Returns the value of a parameter starting with $key

  • return: The value of the parameters or false if it doesn't exists
  • access: public
string getParameterLike (string $key)
  • string $key: The name of the parameter
getQueryString (line 104)

Returns HTTP query string

  • return: The HTTP query string
  • access: public
string getQueryString ()
getQueryType (line 128)

Returns the query type (Action or View)

  • return: The query type [cmd|menu|view] or false if no known query was found
  • access: public
string getQueryType ()
getQueryTypes (line 142)

Returns all valid query types

  • return: An array with all valid query types
  • access: public
array getQueryTypes ([string $postfix = ''])
  • string $postfix: Postfix to add to all query types
getReferrer (line 115)

Returns the referrer of the current page

  • return: The referrer as associative array (type = cmd|view, name = <Action|View name>) or false, if no referrer can be found
  • access: public
array getReferrer ()
getRequestMethod (line 94)

Returns the request method (GET/POST)

  • return: The request method
  • access: public
string getRequestMethod ()
getSubmitParameter (line 246)

Returns the unvalidated value for the given parameter.

Useful if a form has more submit buttons and you want to check which button was used

  • return: The value of the parameters or false if it doesn't exists
  • access: public
string getSubmitParameter (string $key)
  • string $key: The name of the parameter
getView (line 182)

Returns the current view or false if no action was called

  • return: The called view or false if no action was called
  • access: public
string getView ()
hasParameter (line 260)

Returns whether the given parameter exists

  • return: true if it exists, false otherwise
  • access: public
boolean hasParameter (string $key)
  • string $key: The name of the parameter
hasParameterLike (line 279)

Returns whether the a parameter starting with $key exists

  • return: true if it exists, false otherwise
  • access: public
boolean hasParameterLike (string $key)
  • string $key: The name of the parameter
isEmptyRequest (line 155)

Returns whether the current query is empty (then it must be forwarded to a default)

  • return: true if the query is empty, false otherwise
  • access: public
boolean isEmptyRequest ()
setParameter (line 338)

Set a value for a parameter (useful to call other pages)

  • access: public
void setParameter (string $key, string $value)
  • string $key: The name of the parameter
  • string $value: The value
setParameterValid (line 194)

Set the given parameter as valid (passed the validation)

  • access: public
void setParameterValid (string $parameter)
  • string $parameter: The name of the valid parameter

Documentation generated on Wed, 27 Jun 2012 09:45:14 +0200 by phpDocumentor 1.4.4