Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Attributes

http_vars Class Reference

Public Member Functions

 getVar ($prm)
 post ($name, $default=null)
 getVars ($method='post')
 posts ()
 gets ()
 get ($name, $default=null)
 session ($name, $default=null)
 cookie ($name, $default=null)

Static Public Member Functions

static getInstance ()

Private Member Functions

 __construct ()

Static Private Attributes

static $instance

Detailed Description

To retrieve data from environnement

Definition at line 10 of file vars.class.php.


Constructor & Destructor Documentation

__construct (  )  [private]

No direct instanciation for this class

Definition at line 22 of file vars.class.php.


Member Function Documentation

cookie ( name,
default = null 
)

Get a COOKIE variable

Parameters:
string $name Variable Name
mixed default: Possibilities array, first values will be the default or default return, if not found
Returns:
mixed The found variable or the default value or null
See also:
getVar

Definition at line 179 of file vars.class.php.

get ( name,
default = null 
)

Get a GET variable

Parameters:
string $name Variable Name
mixed default: Possibilities array, first values will be the default or default return, if not found
Returns:
mixed The found variable or the default value or null
See also:
getVar

Definition at line 149 of file vars.class.php.

static getInstance (  )  [static]

Get the unique session instance

Returns:
http_vars The instance

Definition at line 29 of file vars.class.php.

gets (  ) 

Get all get variables

Returns:
array
See also:
getVars

Definition at line 137 of file vars.class.php.

getVar ( prm  ) 

Get a variable

Parameters:
string|array $prm if it's a string, it's the variable name. if it's an array, options avaiable are:

  • string name: Variable name
  • string nameIn: Variable name in array
  • array|string method: Method where to get the variable in order of preference (default: array('post','get')) available are: get, post, session, files or cookie
  • mixed default: Possibilities array, first values will be the default or default return, if not found
  • bool trim: True if need to automaticly trim the return
Returns:
mixed The found variable or the default value or null

Definition at line 48 of file vars.class.php.

getVars ( method = 'post'  ) 

Get all type variable of one type

Parameters:
String $method Method name (get or post)
Returns:
array

Definition at line 116 of file vars.class.php.

post ( name,
default = null 
)

Get a POST variable

Parameters:
string $name Variable Name
mixed default: Possibilities array, first values will be the default or default return, if not found
Returns:
mixed The found variable or the default value or null
See also:
getVar

Definition at line 103 of file vars.class.php.

posts (  ) 

Get all post variables

Returns:
array
See also:
getVars

Definition at line 127 of file vars.class.php.

session ( name,
default = null 
)

Get a SESSION variable

Parameters:
string $name Variable Name
mixed default: Possibilities array, first values will be the default or default return, if not found
Returns:
mixed The found variable or the default value or null
See also:
getVar

Definition at line 164 of file vars.class.php.


Field Documentation

$instance [static, private]

Definition at line 17 of file vars.class.php.


The documentation for this class was generated from the following file:
 All Data Structures Files Functions Variables Enumerations
Generated on Tue May 8 2012 16:02:25 for nyroFwk by doxygen 1.7.1