Manual:WebRequest.php

This page is a translated version of the page Manual:WebRequest.php and the translation is 26% complete.

Detalles

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.

You can access the standard WebRequest through RequestContext.php .

You should not create additional instances of this class.

Instead create a DerivativeRequest or use FauxRequest if there is no user request context.

Funciones

  • getVal - get a string, or null if the parameter was not set.
  • getInt - get an integer, or null if the parameter was not set.
  • getBool - same as getVal, but converts the value to a boolean. To know if a parameter is set, use getCheck instead.
  • 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.
  • getCheck - return a boolean whether the parameter was passed, this is useful for checkboxes.
  • getCookie - get a cookie from the $_COOKIE jar.
  • wasPosted - returns a bool whether the request was posted.

... muchos más, esta es una lista parcial.

WebRequestUpload

WebRequestUpload is an object to access the $_FILES array. It should only be called by WebRequest. A WebRequestUpload object is generated by WebRequest::getUpload().

Funciones

  • __construct( $request, $key )

FauxRequest

FauxRequest es una clase que extiende WebRequest. Its purpose is to emulate a request for testing or prototyping. FauxRequest should be avoided in production code.

Also see API:Calling internally for an example.

See also