Joomla CMS  2.5.24 (avec JPlatform 11.4 inclus)
Documentation des API du CMS Joomla en version 2.5 et du framework Joomla Platform intégré
 Tout Classes Espaces de nommage Fichiers Fonctions Variables Pages
Référence de la classe JRequest

Liste de tous les membres

Fonctions membres publiques statiques

static getURI ()
static getMethod ()
static getVar ($name, $default=null, $hash= 'default', $type= 'none', $mask=0)
static getInt ($name, $default=0, $hash= 'default')
static getUInt ($name, $default=0, $hash= 'default')
static getFloat ($name, $default=0.0, $hash= 'default')
static getBool ($name, $default=false, $hash= 'default')
static getWord ($name, $default= '', $hash= 'default')
static getCmd ($name, $default= '', $hash= 'default')
static getString ($name, $default= '', $hash= 'default', $mask=0)
static setVar ($name, $value=null, $hash= 'method', $overwrite=true)
static get ($hash= 'default', $mask=0)
static set ($array, $hash= 'default', $overwrite=true)
static checkToken ($method= 'post')
static clean ()
static _cleanVar ($var, $mask=0, $type=null)

Fonctions membres protégées statiques

static _stripSlashesRecursive ($value)

Documentation des fonctions membres

static JRequest::_cleanVar (   $var,
  $mask = 0,
  $type = null 
)
static

Clean up an input variable.

Paramètres:
mixed$varThe input variable.
integer$maskFilter bit mask. 1 = no trim: If this flag is cleared and the input is a string, the string will have leading and trailing whitespace trimmed. 2 = allow_raw: If set, no more filtering is performed, higher bits are ignored. 4 = allow_html: HTML is allowed, but passed through a safe HTML filter first. If set, no more filtering is performed. If no bits other than the 1 bit is set, a strict filter is applied.
string$typeThe variable type {
Voir également:
JFilterInput::clean()}.
Renvoie:
mixed Same as $var
Obsolète:
12.1
Depuis:
11.1

Références $type, elseif, JFilterInput\getInstance(), et null.

Référencé par JModuleHelper\moduleCache().

+ Voici le graphe d'appel pour cette fonction :

+ Voici le graphe des appelants de cette fonction :

static JRequest::_stripSlashesRecursive (   $value)
staticprotected

Strips slashes recursively on an array.

Paramètres:
array$valueArray or (nested arrays) of strings.
Renvoie:
array The input array with stripslashes applied to it.
Obsolète:
12.1
Depuis:
11.1
static JRequest::checkToken (   $method = 'post')
static

Checks for a form token in the request.

Use in conjunction with JHtml::_('form.token').

Paramètres:
string$methodThe request method in which to look for the token key.
Renvoie:
boolean True if found and valid, false otherwise.
Obsolète:
12.1 Use JSession::checkToken() instead.
Depuis:
11.1

Références $app, $return, JRoute\_(), JText\_(), JFactory\getApplication(), JSession\getFormToken(), et JFactory\getSession().

+ Voici le graphe d'appel pour cette fonction :

static JRequest::clean ( )
static

Cleans the request from script injection.

Renvoie:
void
Depuis:
11.1
Obsolète:
12.1

Références $GLOBALS, et $key.

static JRequest::get (   $hash = 'default',
  $mask = 0 
)
static

Fetches and returns a request array.

The default behaviour is fetching variables depending on the current request method: GET and HEAD will result in returning $_GET, POST and PUT will result in returning $_POST.

You can force the source by setting the $hash parameter:

post $_POST get $_GET files $_FILES cookie $_COOKIE env $_ENV server $_SERVER method via current $_SERVER['REQUEST_METHOD'] default $_REQUEST

Paramètres:
string$hashto get (POST, GET, FILES, METHOD).
integer$maskFilter mask for the variable.
Renvoie:
mixed Request hash.
Obsolète:
12.1 User JInput::get
Voir également:
JInput
Depuis:
11.1

Référencé par SearchViewSearch\display(), JModuleHelper\moduleCache(), et plgSystemLanguageFilter\parseRule().

+ Voici le graphe des appelants de cette fonction :

static JRequest::getBool (   $name,
  $default = false,
  $hash = 'default' 
)
static

Fetches and returns a given filtered variable. The bool filter will only return true/false bool values. This is currently only a proxy function for getVar().

See getVar() for more in-depth documentation on the parameters.

Paramètres:
string$nameVariable name.
string$defaultDefault value if the variable does not exist.
string$hashWhere the var should come from (POST, GET, FILES, COOKIE, METHOD).
Renvoie:
boolean Requested variable.
Obsolète:
12.1
Depuis:
11.1

Références $name.

Référencé par JFactory\createDocument(), ContentViewArticle\display(), NewsfeedsViewNewsfeed\display(), JModuleHelper\getModules(), UsersControllerUser\login(), plgContentPagenavigation\onContentBeforeDisplay(), plgContentPagebreak\onContentPrepare(), et JModuleHelper\renderModule().

+ Voici le graphe des appelants de cette fonction :

static JRequest::getCmd (   $name,
  $default = '',
  $hash = 'default' 
)
static

Cmd (Word and Integer0 filter

Fetches and returns a given filtered variable. The cmd filter only allows the characters [A-Za-z0-9.-_]. This is currently only a proxy function for getVar().

See getVar() for more in-depth documentation on the parameters.

Paramètres:
string$nameVariable name
string$defaultDefault value if the variable does not exist
string$hashWhere the var should come from (POST, GET, FILES, COOKIE, METHOD)
Renvoie:
string Requested variable
Obsolète:
12.1
Depuis:
11.1

Références $name.

Référencé par ContentController\__construct(), ContentControllerArticle\__construct(), CategoriesController\__construct(), ContentControllerArticles\__construct(), CategoriesControllerCategory\__construct(), CategoriesViewCategory\addToolbar(), JModel\cleanCache(), CategoriesModelCategory\cleanCache(), TemplatesControllerTemplate\copy(), MediaControllerFolder\create(), JoomlaupdateModelDefault\createRestorationFile(), MediaControllerFolder\delete(), MediaControllerFile\delete(), JSite\dispatch(), MediaController\display(), MenusController\display(), ModulesController\display(), NewsfeedsController\display(), MessagesController\display(), PluginsController\display(), CacheController\display(), BannersController\display(), JoomlaupdateController\display(), WeblinksController\display(), WrapperController\display(), InstallerController\display(), TemplatesViewPrevuuw\display(), ContactController\display(), ContentController\display(), LanguagesController\display(), RedirectController\display(), SearchController\display(), TemplatesController\display(), ConfigController\display(), CategoriesController\display(), UsersController\display(), JoomlaupdateControllerUpdate\display(), JController\display(), LanguagesControllerOverride\edit(), JAdministratorHelper\findOption(), JApplicationHelper\getComponentName(), JFormFieldMedia\getInput(), LanguagesModelOverride\getItem(), modRelatedItemsHelper\getList(), modArticlesCategoryHelper\getList(), AdminModelHelp\getPage(), JSite\getParams(), JApplicationHelper\getPath(), ContentControllerArticle\getRedirectToItemAppend(), JControllerForm\getRedirectToItemAppend(), JControllerForm\getRedirectToListAppend(), MediaModelManager\getState(), JSite\getTemplate(), JInstallation\initialise(), JAdministrator\login(), plgContentPagenavigation\onContentBeforeDisplay(), plgButtonImage\onDisplay(), ContentModelForm\populateState(), WeblinksModelForm\populateState(), ConfigModelComponent\populateState(), ContentModelArticles\populateState(), ContentModelCategory\populateState(), CategoriesModelCategory\populateState(), NewsfeedsModelCategory\populateState(), ContactModelFeatured\populateState(), WeblinksModelCategory\populateState(), ContactModelCategory\populateState(), MenusModelItem\populateState(), JControllerAdmin\publish(), CategoriesModelCategory\publish(), CategoriesControllerCategories\rebuild(), JInstallation\render(), JAdministrator\render(), JDocumentFeed\render(), JSite\render(), ConfigControllerComponent\save(), LanguagesControllerOverride\save(), LanguagesModelStrings\search(), LanguagesControllerInstalled\setDefault(), et MenusControllerItem\setType().

static JRequest::getFloat (   $name,
  $default = 0.0,
  $hash = 'default' 
)
static

Fetches and returns a given filtered variable. The float filter only allows digits and periods. This is currently only a proxy function for getVar().

See getVar() for more in-depth documentation on the parameters.

Paramètres:
string$nameVariable name.
string$defaultDefault value if the variable does not exist.
string$hashWhere the var should come from (POST, GET, FILES, COOKIE, METHOD).
Renvoie:
float Requested variable.
Depuis:
11.1
Obsolète:
12.1

Références $name.

static JRequest::getInt (   $name,
  $default = 0,
  $hash = 'default' 
)
static

Fetches and returns a given filtered variable. The integer filter will allow only digits and the - sign to be returned. This is currently only a proxy function for getVar().

See getVar() for more in-depth documentation on the parameters.

Paramètres:
string$nameVariable name.
string$defaultDefault value if the variable does not exist.
string$hashWhere the var should come from (POST, GET, FILES, COOKIE, METHOD).
Renvoie:
integer Requested variable.
Depuis:
11.1
Obsolète:
12.1

Références $name.

Référencé par ContentModelCategory\_buildContentOrderBy(), plgContentPagebreak\_createTOC(), JModuleHelper\_load(), JHtmlSliders\_loadBehavior(), JRouterSite\_parseRawRoute(), InstallerControllerUpdate\ajax(), ContactControllerContact\allowAdd(), WeblinksControllerWeblink\allowAdd(), NewsfeedsControllerNewsfeed\allowAdd(), BannersControllerBanner\allowAdd(), ContentControllerArticle\allowAdd(), JControllerForm\cancel(), BannersController\click(), TemplatesControllerTemplate\copy(), MenusViewMenutypes\display(), NewsfeedsController\display(), PluginsController\display(), BannersController\display(), MessagesController\display(), MenusController\display(), ModulesController\display(), WeblinksController\display(), ContentController\display(), ContactController\display(), RedirectController\display(), TemplatesController\display(), LanguagesController\display(), CategoriesController\display(), UsersController\display(), UsersControllerProfile\edit(), JControllerForm\edit(), JFormFieldRules\getInput(), modArticlesCategoryHelper\getList(), WeblinksControllerWeblink\getRedirectToItemAppend(), ContentControllerArticle\getRedirectToItemAppend(), JSite\getTemplate(), WeblinksControllerWeblink\go(), ContentModelArticle\hit(), WeblinksModelWeblink\loadFormData(), NewsfeedsModelNewsfeed\loadFormData(), ContentModelArticle\loadFormData(), ContactModelContact\loadFormData(), BannersModelBanner\loadFormData(), LoginController\logout(), BannersModelDownload\populateState(), ContentModelForm\populateState(), MessagesModelMessage\populateState(), WeblinksModelWeblink\populateState(), ContentModelArticle\populateState(), ContentModelArchive\populateState(), NewsfeedsModelNewsfeed\populateState(), LanguagesModelLanguage\populateState(), WeblinksModelForm\populateState(), ContactModelContact\populateState(), NewsfeedsModelCategories\populateState(), ContactModelCategories\populateState(), ContentModelCategories\populateState(), WeblinksModelCategories\populateState(), ModulesModelPositions\populateState(), TemplatesModelStyle\populateState(), ModulesModelModule\populateState(), LanguagesModelInstalled\populateState(), MenusModelMenu\populateState(), TemplatesModelTemplate\populateState(), ContentModelCategory\populateState(), CategoriesModelCategory\populateState(), PluginsModelPlugin\populateState(), JModelAdmin\populateState(), MenusModelItem\populateState(), MessagesControllerMessage\reply(), JSite\route(), ConfigControllerComponent\save(), MenusControllerMenu\save(), MenusControllerItem\save(), JControllerForm\save(), SearchController\search(), LanguagesModelStrings\search(), MenusControllerItem\setType(), et ContentControllerArticle\vote().

static JRequest::getMethod ( )
static

Gets the request method.

Renvoie:
string
Depuis:
11.1
Obsolète:
12.1
static JRequest::getString (   $name,
  $default = '',
  $hash = 'default',
  $mask = 0 
)
static

Fetches and returns a given filtered variable. The string filter deletes 'bad' HTML code, if not overridden by the mask. This is currently only a proxy function for getVar().

See getVar() for more in-depth documentation on the parameters.

Paramètres:
string$nameVariable name
string$defaultDefault value if the variable does not exist
string$hashWhere the var should come from (POST, GET, FILES, COOKIE, METHOD)
integer$maskFilter mask for the variable
Renvoie:
string Requested variable
Depuis:
11.1
Obsolète:
12.1

Références $name.

Référencé par plgSystemLogout\__construct(), SearchModelSearch\__construct(), InstallerModelInstall\_getPackageFromFolder(), InstallerModelInstall\_getPackageFromUrl(), RedirectControllerLinks\activate(), UsersHelper\addSubmenu(), JElementMenuItem\fetchElement(), MailtoViewMailto\getData(), AdminModelHelp\getHelpSearch(), ContentModelArticles\getItems(), modRelatedItemsHelper\getList(), JSite\initialise(), UsersControllerUser\login(), plgSystemRemember\onAfterInitialise(), plgCaptchaRecaptcha\onCheckAnswer(), plgContentJoomla\onContentBeforeDelete(), plgContentVote\onContentBeforeDisplay(), plgContentPagebreak\onContentPrepare(), plgSystemLanguageFilter\parseRule(), BannersModelDownload\populateState(), ContentModelArchive\populateState(), ConfigModelComponent\populateState(), ContentModelCategory\populateState(), JComponentHelper\renderComponent(), MenusControllerItems\saveorder(), CategoriesControllerCategories\saveorder(), SearchController\search(), LanguagesModelStrings\search(), MailtoController\send(), JClientHelper\setCredentialsFromRequest(), ContactControllerContact\submit(), et ContentControllerArticle\vote().

+ Voici le graphe des appelants de cette fonction :

static JRequest::getUInt (   $name,
  $default = 0,
  $hash = 'default' 
)
static

Fetches and returns a given filtered variable. The unsigned integer filter will allow only digits to be returned. This is currently only a proxy function for getVar().

See getVar() for more in-depth documentation on the parameters.

Paramètres:
string$nameVariable name.
string$defaultDefault value if the variable does not exist.
string$hashWhere the var should come from (POST, GET, FILES, COOKIE, METHOD).
Renvoie:
integer Requested variable.
Obsolète:
12.1
Depuis:
11.1

Références $name.

Référencé par SearchModelSearch\__construct(), plgContentPagebreak\_createTOC(), ContentModelArchive\getData(), NewsfeedsModelNewsfeed\populateState(), ContentModelArticle\populateState(), ContentModelFeatured\populateState(), ContentModelArticles\populateState(), ContentModelCategory\populateState(), NewsfeedsModelCategory\populateState(), ContactModelFeatured\populateState(), WeblinksModelCategory\populateState(), ContactModelCategory\populateState(), et SearchController\search().

+ Voici le graphe des appelants de cette fonction :

static JRequest::getURI ( )
static

Gets the full request path.

Renvoie:
string
Depuis:
11.1
Obsolète:
12.1

Références $uri, et JFactory\getURI().

Référencé par JCache\makeId().

+ Voici le graphe d'appel pour cette fonction :

+ Voici le graphe des appelants de cette fonction :

static JRequest::getVar (   $name,
  $default = null,
  $hash = 'default',
  $type = 'none',
  $mask = 0 
)
static

Fetches and returns a given variable.

The default behaviour is fetching variables depending on the current request method: GET and HEAD will result in returning an entry from $_GET, POST and PUT will result in returning an entry from $_POST.

You can force the source by setting the $hash parameter:

post $_POST get $_GET files $_FILES cookie $_COOKIE env $_ENV server $_SERVER method via current $_SERVER['REQUEST_METHOD'] default $_REQUEST

Paramètres:
string$nameVariable name.
string$defaultDefault value if the variable does not exist.
string$hashWhere the var should come from (POST, GET, FILES, COOKIE, METHOD).
string$typeReturn type for the variable, for valid values see JFilterInput::clean().
integer$maskFilter mask for the variable.
Renvoie:
mixed Requested variable.
Depuis:
11.1
Obsolète:
12.1 Use JInput::Get

Références $GLOBALS, $name, $type, elseif, et null.

Référencé par SearchModelSearch\__construct(), InstallerModelInstall\_getPackageFromUpload(), JElementTemplateStyle\_getSelected(), JSession\_start(), RedirectControllerLinks\activate(), UsersControllerRegistration\activate(), UsersControllerUsers\activate(), InstallerControllerUpdate\ajax(), UsersControllerUsers\changeBlock(), CheckinController\checkin(), JControllerAdmin\checkin(), JSession\checkToken(), UsersControllerReset\complete(), UsersControllerReset\confirm(), TemplatesControllerTemplate\copy(), MediaControllerFolder\create(), JoomlaupdateModelDefault\createRestorationFile(), JInstallationControllerSetup\database(), ContentControllerFeatured\delete(), MediaControllerFolder\delete(), LanguagesControllerOverrides\delete(), UsersControllerLevel\delete(), MenusControllerMenus\delete(), CacheController\delete(), CategoriesControllerCategories\delete(), JControllerAdmin\delete(), MediaControllerFile\delete(), JInstallationControllerSetup\detectFtpRoot(), InstallerModelDiscover\discover_install(), MediaViewMediaList\display(), WeblinksViewCategory\display(), ContentViewArticle\display(), TemplatesViewPrevuuw\display(), BannersControllerTracks\display(), TemplatesControllerStyles\duplicate(), ModulesControllerModules\duplicate(), LanguagesControllerOverride\edit(), TemplatesControllerSource\edit(), JControllerForm\edit(), ContactControllerContacts\featured(), ContentControllerArticles\featured(), JElementMenuItem\fetchElement(), JInstallationControllerSetup\filesystem(), MailtoViewMailto\getData(), JController\getInstance(), WeblinksControllerWeblink\getReturnPage(), ContentControllerArticle\getReturnPage(), MediaModelManager\getState(), MediaModelList\getState(), JSite\getTemplate(), JModelList\getUserStateFromRequest(), InstallerControllerLanguages\install(), UsersModelLogin\loadFormData(), JInstallationControllerSetup\loadSampleData(), UsersControllerUser\login(), UsersControllerUser\logout(), JCache\makeId(), JModuleHelper\moduleCache(), plgCaptchaRecaptcha\onCheckAnswer(), LoginModelLogin\populateState(), ContentModelForm\populateState(), WeblinksModelForm\populateState(), InstallerModelManage\populateState(), UsersModelUsers\populateState(), MenusModelItems\populateState(), ContactModelContacts\populateState(), ContentModelArticles\populateState(), UsersModelDebugUser\populateState(), UsersModelDebugGroup\populateState(), NewsfeedsModelCategory\populateState(), WeblinksModelCategory\populateState(), ContactModelCategory\populateState(), InstallerControllerManage\publish(), JControllerAdmin\publish(), InstallerControllerManage\refresh(), UsersControllerRegistration\register(), UsersControllerUser\register(), UsersControllerRemind\remind(), UsersControllerUser\remind(), InstallerControllerManage\remove(), JInstallationControllerSetup\removeFolder(), JInstallation\render(), JControllerAdmin\reorder(), UsersControllerReset\request(), MessagesControllerConfig\save(), ConfigControllerComponent\save(), ConfigControllerApplication\save(), MenusControllerMenu\save(), AdminControllerProfile\save(), LanguagesControllerOverride\save(), UsersControllerProfile\save(), UsersControllerUser\save(), MenusControllerItem\save(), TemplatesControllerSource\save(), CategoriesModelCategory\save(), TemplatesModelStyle\save(), ContentModelArticle\save(), JControllerForm\save(), ModulesModelModule\save(), JInstallationControllerSetup\saveconfig(), MenusControllerItems\saveorder(), CategoriesControllerCategories\saveorder(), JControllerAdmin\saveorder(), SearchController\search(), UsersModelMail\send(), TemplatesControllerStyles\setDefault(), MenusControllerItems\setDefault(), JInstallationControllerSetup\setlanguage(), MenusControllerItem\setType(), BannersControllerBanners\sticky_publish(), ContactControllerContact\submit(), TemplatesControllerStyles\unsetDefault(), InstallerControllerUpdate\update(), MediaControllerFile\upload(), et JInstallationControllerSetup\verifyFtpSettings().

static JRequest::getWord (   $name,
  $default = '',
  $hash = 'default' 
)
static

Fetches and returns a given filtered variable. The word filter only allows the characters [A-Za-z_]. This is currently only a proxy function for getVar().

See getVar() for more in-depth documentation on the parameters.

Paramètres:
string$nameVariable name.
string$defaultDefault value if the variable does not exist.
string$hashWhere the var should come from (POST, GET, FILES, COOKIE, METHOD).
Renvoie:
string Requested variable.
Depuis:
11.1
Obsolète:
12.1

Références $name.

Référencé par SearchModelSearch\__construct(), JFactory\createDocument(), CheckinController\display(), JInstallationController\display(), JInstallationModelSetup\getForm(), JController\getInstance(), InstallerModelInstall\install(), ContactModelCategory\populateState(), SearchController\search(), et JHtmlInstallation\stepbar().

+ Voici le graphe des appelants de cette fonction :

static JRequest::set (   $array,
  $hash = 'default',
  $overwrite = true 
)
static

Sets a request variable.

Paramètres:
array$arrayAn associative array of key-value pairs.
string$hashThe request variable to set (POST, GET, FILES, METHOD).
boolean$overwriteIf true and an existing key is found, the value is overwritten, otherwise it is ignored.
Renvoie:
void
Obsolète:
12.1 Use JInput::Set
Voir également:
JInput::Set
Depuis:
11.1

Références $key.

Référencé par JApplication\route().

+ Voici le graphe des appelants de cette fonction :

static JRequest::setVar (   $name,
  $value = null,
  $hash = 'method',
  $overwrite = true 
)
static

Set a variable in one of the request variables.

Paramètres:
string$nameName
string$valueValue
string$hashHash
boolean$overwriteBoolean
Renvoie:
string Previous value
Depuis:
11.1
Obsolète:
12.1

Références $GLOBALS, $name, et null.

Référencé par plgSystemLanguageFilter\__construct(), UsersViewMail\addToolbar(), MenusViewMenu\addToolbar(), NewsfeedsViewNewsfeed\addToolbar(), PluginsViewPlugin\addToolbar(), LanguagesViewLanguage\addToolbar(), TemplatesViewTemplate\addToolbar(), TemplatesViewStyle\addToolbar(), UsersViewGroup\addToolbar(), AdminViewProfile\addToolbar(), WeblinksViewWeblink\addToolbar(), UsersViewLevel\addToolbar(), ContactViewContact\addToolbar(), MenusViewItem\addToolbar(), RedirectViewLink\addToolbar(), ModulesViewModule\addToolbar(), BannersViewBanner\addToolbar(), BannersViewClient\addToolbar(), UsersViewUser\addToolbar(), TemplatesViewSource\addToolbar(), ContentViewArticle\addToolbar(), LanguagesViewOverride\addToolbar(), TemplatesControllerTemplate\copy(), MediaControllerFolder\create(), ContentViewFeatured\display(), ContentViewCategory\display(), ContactViewCategory\display(), ConfigViewComponent\display(), WeblinksViewCategory\display(), CpanelViewCpanel\display(), CategoriesViewCategory\display(), WrapperController\display(), SearchController\display(), NewsfeedsController\display(), JInstallationController\display(), WeblinksController\display(), LoginController\display(), ContactController\display(), ContentController\display(), JAdministratorHelper\findOption(), JApplicationHelper\getComponentName(), JController\getInstance(), JModelList\getUserStateFromRequest(), MailtoController\mailto(), MenusModelItems\populateState(), TemplatesController\preview(), SearchController\search(), et MailtoController\send().

+ Voici le graphe des appelants de cette fonction :


La documentation de cette classe a été générée à partir du fichier suivant :