nyroFwk  0.2
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()

__construct ( )
private

No direct instanciation for this class

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

Member Function Documentation

◆ cookie()

cookie (   $name,
  $default = null 
)

Get a COOKIE variable

Parameters
string$nameVariable Name
mixeddefault: 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()

get (   $name,
  $default = null 
)

Get a GET variable

Parameters
string$nameVariable Name
mixeddefault: 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.

◆ getInstance()

static getInstance ( )
static

Get the unique session instance

Returns
http_vars The instance

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

◆ gets()

gets ( )

Get all get variables

Returns
array
See also
getVars

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

◆ getVar()

getVar (   $prm)

Get a variable

Parameters
string | array$prmif 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()

getVars (   $method = 'post')

Get all type variable of one type

Parameters
String$methodMethod name (get or post)
Returns
array

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

◆ post()

post (   $name,
  $default = null 
)

Get a POST variable

Parameters
string$nameVariable Name
mixeddefault: 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()

posts ( )

Get all post variables

Returns
array
See also
getVars

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

◆ session()

session (   $name,
  $default = null 
)

Get a SESSION variable

Parameters
string$nameVariable Name
mixeddefault: 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

$instance
staticprivate

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


The documentation for this class was generated from the following file:
Generated on Sun Oct 15 2017 22:25:21 for nyroFwk by doxygen 1.8.13