Class myMVC_HttpRequest

Description

Manager for the request

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


	
			
Variable Summary
 static mixed $TYPE_ACTION
 static mixed $TYPE_AJAX
 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 getSubmitParameterLike (string $key)
 string getSubmitParameterNameLike (string $key)
 array getSubmitUpload (string $key)
 array getUpload (string $key)
 string getView ()
 boolean hasParameter (string $key)
 boolean hasParameterLike (string $key)
 boolean hasSubmitParameter (string $key)
 boolean hasSubmitParameterLike (string $key)
 boolean hasUpload (string $key)
 boolean isAJAX ()
 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_AJAX = 'ajax' (line 44)

Action type (called from AJAX)

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

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 52)

View type

  • access: public
Methods
static getInstance (line 86)

Returns the instance of this class.

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

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 229)

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 253)

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

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

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

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 402)

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 111)

Returns HTTP query string

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

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 149)

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 122)

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 101)

Returns the request method (GET/POST)

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

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
getSubmitParameterLike (line 314)

Returns the unvalidated value for the parameter starting with $key.

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 getSubmitParameterLike (string $key)
  • string $key: The name of the parameter
getSubmitParameterNameLike (line 330)

Returns the name of the parameter starting with $key.

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

  • return: The name of the parameters or false if it doesn't exists
  • access: public
string getSubmitParameterNameLike (string $key)
  • string $key: The name of the parameter
getSubmitUpload (line 436)

Returns the unvalidated value for the given upload.

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
array getSubmitUpload (string $key)
  • string $key: The name of the parameter
getUpload (line 471)

Return the upload file, if given

  • return: Associative array with the file data ot false if no file uploaded Keys: name, type, size, tmp_name, error
  • access: public
array getUpload (string $key)
  • string $key: The name of the parameter
getView (line 203)

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 344)

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 363)

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
hasSubmitParameter (line 268)

Returns whether the given unvalidated parameter exists

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

Returns whether the an unvalidated parameter starting with $key exists

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

Returns whether the given upload exists and a file was uploaded

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

Returns if the current action was called as AJAX

  • return: true if the current Action was called as AJAX, false otherwise
  • access: public
boolean isAJAX ()
isEmptyRequest (line 162)

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 422)

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 215)

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, 09 Mar 2016 21:27:02 +0100 by phpDocumentor 1.4.4