Manual:WebRequest.php

From MediaWiki.org
Jump to: navigation, search
MediaWiki File: WebRequest.php
Location: /includes/
Source code:

HEAD1.19.0rc1
1.19.01.18.3

Classes: WebRequestFauxRequest


[edit] WebRequest

The WebRequest class which encapsulates getting at data passed in the URL or via a POSTed form, handling remove of "magic quotes" slashes, stripping illegal input characters and normalizing Unicode sequences. A global instance of this class is available in $wgRequest. You should not create an other instance of this class, instead, use FauxRequest.

[edit] Functions

  • function getVal: get a scalar or null if the parameter was not passed.
  • function getInt: same as before, but the value returned is an integer.
  • function getBool: same as getVal, but returns a boolean value
  • function getArray: get an array or null if the parameter was not passed. If the parameter is a scalar, it will return an array with a single element.
  • function getCheck: return a boolean whether the parameter was passed, this is useful for checkboxes.
  • function wasPosted: returns a bool whether the request was posted

[edit] FauxRequest

FauxRequest is a class extending WebRequest. Its purpose is to emulate a request with the values passed to the constructor.

Personal tools
Namespaces

Variants
Actions
Navigation
Support
Download
Development
Communication
Print/export
Toolbox