|
static | init () |
|
static | parseParam ($param) |
|
static | createParam ($param, $urlify=true) |
|
static | forward ($request) |
|
static | forceSecure () |
|
static | get ($get=null) |
|
static | getRequested ($get=null) |
|
static | getCfg ($key=null) |
|
static | hasPrm ($key) |
|
static | getPrm ($key, $default=null) |
|
static | getPathControllerUri ($forceController=false) |
|
static | uri ($prm=array()) |
|
static | uploadedUri ($file, array $prm=array()) |
|
static | uriDef (array $prm=array(), array $use=array('lang', 'module', 'action', 'param', 'out')) |
|
static | uriString ($uri) |
|
static | webUri ($uri, $absolute=false) |
|
static | isAbsolutizeAllUris () |
|
static | getIp () |
|
static | isPost () |
|
static | isLocal () |
|
static | isAjax () |
|
static | isMobile ($test=null) |
|
static | isScaffolded () |
|
static | extractGet (&$request, $affectGet=false) |
|
static | analyseRequest ($request, $alias=true) |
|
static | alias ($request) |
|
static | removeLangOutUrl ($request) |
|
static | getModule () |
|
static | execModule () |
|
static | publishModule () |
|
static | isLang ($lang) |
|
static | avlLang ($withName=false) |
|
static | getDefaultLang () |
|
static | isOut ($out) |
|
static | getResponseName () |
|
Store the client request Singleton
Definition at line 11 of file request.class.php.
◆ __construct()
◆ alias()
Parse a request to find an alias match
- Parameters
-
string | $request | The request to parse |
- Returns
- string the real request
Definition at line 842 of file request.class.php.
◆ analyseRequest()
static analyseRequest |
( |
|
$request, |
|
|
|
$alias = true |
|
) |
| |
|
static |
Analyse a request. If some element are empty, the default is replaced
- Parameters
-
string | $request | The requested string |
bool | $alias | Indicate if alias should be used |
- Returns
- array Array with the key lang, module, action, param, text and out
Definition at line 800 of file request.class.php.
◆ avlLang()
static avlLang |
( |
|
$withName = false | ) |
|
|
static |
Get the available langs
- Parameters
-
bool | $withName | If the language name are needed |
- Returns
- array
Definition at line 942 of file request.class.php.
◆ createParam()
static createParam |
( |
|
$param, |
|
|
|
$urlify = true |
|
) |
| |
|
static |
◆ execModule()
Execute the action requested
- Returns
- mixed Return from the executed action
Definition at line 911 of file request.class.php.
◆ extractGet()
static extractGet |
( |
& |
$request, |
|
|
|
$affectGet = false |
|
) |
| |
|
static |
Analyse a request to extract the get information (after the ?) The $request variable will be modified to remove the get information
- Parameters
-
string | $request | |
bool | $affectGet | Affect the information found to the $_GET array |
- Returns
- array
Definition at line 774 of file request.class.php.
◆ fixFiles()
◆ forceSecure()
Force the request to be secure, by redirting to the same url with https
Definition at line 359 of file request.class.php.
◆ forward()
static forward |
( |
|
$request | ) |
|
|
static |
USed to forward the actual request to an other
- Parameters
-
string | $request | The new request |
- Returns
- mixed The executed action return
Definition at line 350 of file request.class.php.
◆ get()
static get |
( |
|
$get = null | ) |
|
|
static |
Element requested
- Parameters
-
null|string | get Element you want. Possible value:
- uri
- pathUri
- rootUri
- secure
- protocol
- controller
- domain
- path
- pathWithController
- request
- lang
- module
- action
- param
- paramA
- text
- out
|
- Returns
- array|mixed uriInfo if $get parameter is null, the whole array
Definition at line 387 of file request.class.php.
◆ getCfg()
static getCfg |
( |
|
$key = null | ) |
|
|
static |
Get a request config or the whole config array
- Parameters
-
string | null | $key | Key to retrieve or null to retrieve the array |
- Returns
- mixed
Definition at line 426 of file request.class.php.
◆ getDefaultLang()
static getDefaultLang |
( |
| ) |
|
|
static |
Get the default lang defined
- Returns
- string The default lang
Definition at line 953 of file request.class.php.
◆ getIp()
◆ getModule()
◆ getPathControllerUri()
static getPathControllerUri |
( |
|
$forceController = false | ) |
|
|
static |
Get the URL part between the domain and the request, with the controller name if it's on the current request
- Parameters
-
bool | $forceController | Force the Controller script name on the return |
- Returns
- string
Definition at line 461 of file request.class.php.
◆ getPrm()
static getPrm |
( |
|
$key, |
|
|
|
$default = null |
|
) |
| |
|
static |
Get a request parameter
- Parameters
-
string | $key | Parameter name |
mixed | $default | Default value if not defined |
- Returns
- mixed
Definition at line 450 of file request.class.php.
◆ getRequested()
static getRequested |
( |
|
$get = null | ) |
|
|
static |
Get an element requested in the url
- Parameters
-
- Returns
- array|mixed
- See also
- get
Definition at line 409 of file request.class.php.
◆ getResponseName()
static getResponseName |
( |
| ) |
|
|
static |
Get the reponse name associate to the request out
- Returns
- string
Definition at line 972 of file request.class.php.
◆ hasPrm()
Check if the current request has the $key parameter
- Parameters
-
- Returns
- bool
Definition at line 439 of file request.class.php.
◆ init()
Initialize the request object Call by the init function from nyro class
Definition at line 92 of file request.class.php.
◆ initModule()
◆ isAbsolutizeAllUris()
static isAbsolutizeAllUris |
( |
| ) |
|
|
static |
Indicates if it's configured to absolutiez all URIs
- Returns
- boolean
Definition at line 653 of file request.class.php.
◆ isAjax()
Check if the current request is an Ajax
- Returns
- bool
Definition at line 689 of file request.class.php.
◆ isLang()
Check if it's an available lang
- Parameters
-
- Returns
- bool
Definition at line 932 of file request.class.php.
◆ isLocal()
◆ isMobile()
static isMobile |
( |
|
$test = null | ) |
|
|
static |
Check if the current request is mobile
- Parameters
-
null | string | array | $test | 3 differents options:
- null: no more test are done
- string: the mobileStatus has to be the same
- array: mobileStatus has to be in this array
|
- Returns
- boolean
Definition at line 702 of file request.class.php.
◆ isOut()
Check if it's an available out
- Parameters
-
- Returns
- bool
Definition at line 963 of file request.class.php.
◆ isPost()
◆ isScaffolded()
Check if the module requested was scaffolded
- Returns
- bool
Definition at line 762 of file request.class.php.
◆ parseParam()
static parseParam |
( |
|
$param | ) |
|
|
static |
Extract the param
- Parameters
-
- Returns
- array Parameters in array
Definition at line 306 of file request.class.php.
◆ publishModule()
Publish the module requested
- Returns
- string The module published
Definition at line 921 of file request.class.php.
◆ removeLangOutUrl()
static removeLangOutUrl |
( |
|
$request | ) |
|
|
static |
◆ uploadedUri()
static uploadedUri |
( |
|
$file, |
|
|
array |
$prm = array() |
|
) |
| |
|
static |
Make a valid URI for an uploaded File
- Parameters
-
string | $file | The filepath |
array | $prm | Array to overwritte default uri construction |
- Returns
- string The valid URI
Definition at line 561 of file request.class.php.
◆ uri()
static uri |
( |
|
$prm = array() | ) |
|
|
static |
Create an URI starting with /, regarding the current request By default, the controller will stay the same
- Parameters
-
string | array | $prm | URL Parameters:
- bool absolute If the url should be absolute
- string sep Seperator if needed (default: cfg config empty)
- strong controller
- string lang (if not valid it will be ignored)
- string module
- string action
- array paramA
- string param (using only if paramA doesn't exist)
- string text
- string out (if not valid it will be ignored)
|
- Returns
- string the URL
Definition at line 483 of file request.class.php.
◆ uriDef()
static uriDef |
( |
array |
$prm = array() , |
|
|
array |
$use = array('lang', 'module', 'action', 'param', 'out') |
|
) |
| |
|
static |
Create an array to create an uri with the requested value by default, overwritten by $prm
- Parameters
-
array | $prm | Array to use in the uri |
array | $use | Element to use by default in the uri |
- Returns
- string the uri
- See also
- uri
Definition at line 579 of file request.class.php.
◆ uriString()
Convert a string uri to an array usuable for request::uri. Starting with // will remove the controller. Starting with /// will remove the controller and absolutize the URI.
- Parameters
-
- Returns
- array
Definition at line 596 of file request.class.php.
◆ webUri()
static webUri |
( |
|
$uri, |
|
|
|
$absolute = false |
|
) |
| |
|
static |
Create a Web uri from a string (starting at the www folder)
- Parameters
-
string | $uri | |
boolean | $absolute | |
- Returns
- string
Definition at line 644 of file request.class.php.
◆ $cfg
◆ $mobileStatus
◆ $module
◆ $requestedUriInfo
◆ $scaffold
◆ $uriInfo
The documentation for this class was generated from the following file: