This is the documentation for concrete5 version 5.6 and earlier. View Current Documentation

Request

The concrete5 Request object handles information about the currently requested resource. This is typically a page but may also contain information about a controller task and its parameters.

Obtaining the Request object

The request object can be obtained from within an addon, block, theme or page controller by using the following command:

	$req = Request::get();

Methods

$req->getRequestPath();

Returns the currently requested path.

$req->getRequestCollectionPath();

Gets the current collection path as contained in the current request.

$req->getRequestCollectionID();

Gets page ID of the current request.

$req->getRequestTask();

Gets the current MVC task of the request. This is the function that will be run by the current page controller (if it exists.).

$array = $req->getRequestTaskParameters();

Gets the array of parameters for this current MVC task

$boolean = $req->isIncludeRequest();

Returns whether this request wants to include a file (typically a tool).

$req->getIncludeType()

Returns the include type of the current request.

$req->getFilename()

If the current request wants to include a file, this returns the filename it wants to include

$req->getBlock()

Gets the block requested by the current request.

$req->getAuxiliaryData()

Returns auxiliary data is anything that the request specifies that doesn't really fit inside the request object, but gets passed along anyway.

$req->getPackageHandle()

Gets the package requested by the current request.

$req->setRequestTask()

Sets the controller task, used when the Page object identifies the actual path.

$req->setRequestTaskParameters(array $params)

Sets the controller params, used when the Page object identifies the actual path.

$req->setCollectionPath($path)

Sets the request path, used when the Page object identifies the actual path.

Loading Conversation