Documentation

RequestStack
in package

Request stack that controls the lifecycle of requests.

Tags
author

Benjamin Eberlei kontakt@beberlei.de

Table of Contents

$requests  : array<string|int, Request>
getCurrentRequest()  : Request|null
getMainRequest()  : Request|null
Gets the main request.
getMasterRequest()  : Request|null
Gets the master request.
getParentRequest()  : Request|null
Returns the parent request of the current.
getSession()  : SessionInterface
Gets the current session.
pop()  : Request|null
Pops the current request from the stack.
push()  : mixed
Pushes a Request on the stack.

Properties

Methods

getMainRequest()

Gets the main request.

public getMainRequest() : Request|null

Be warned that making your code aware of the main request might make it un-compatible with other features of your framework like ESI support.

Return values
Request|null

getMasterRequest()

Gets the master request.

public getMasterRequest() : Request|null
Tags
deprecated

since symfony/http-foundation 5.3, use getMainRequest() instead

Return values
Request|null

getParentRequest()

Returns the parent request of the current.

public getParentRequest() : Request|null

Be warned that making your code aware of the parent request might make it un-compatible with other features of your framework like ESI support.

If current Request is the main request, it returns null.

Return values
Request|null

pop()

Pops the current request from the stack.

public pop() : Request|null

This operation lets the current request go out of scope.

This method should generally not be called directly as the stack management should be taken care of by the application itself.

Return values
Request|null

push()

Pushes a Request on the stack.

public push(Request $request) : mixed

This method should generally not be called directly as the stack management should be taken care of by the application itself.

Parameters
$request : Request
Return values
mixed

Search results