\Symfony\Component\HttpFoundationRequestStack

Request stack that controls the lifecycle of requests.

Summary

Methods
Properties
Constants
push()
pop()
getCurrentRequest()
getMainRequest()
getMasterRequest()
getParentRequest()
getSession()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$requests
N/A

Properties

$requests

$requests : \Symfony\Component\HttpFoundation\Request[]

Type

Request[]

Methods

push()

push(\Symfony\Component\HttpFoundation\Request  $request) : mixed

Pushes a Request on the stack.

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

Parameters

\Symfony\Component\HttpFoundation\Request $request

Returns

mixed —

pop()

pop() : \Symfony\Component\HttpFoundation\Request|null

Pops the current request from the stack.

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.

Returns

\Symfony\Component\HttpFoundation\Request|null —

getCurrentRequest()

getCurrentRequest() : \Symfony\Component\HttpFoundation\Request|null

Returns

\Symfony\Component\HttpFoundation\Request|null —

getMainRequest()

getMainRequest() : ?\Symfony\Component\HttpFoundation\Request

Gets the main request.

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.

Returns

?\Symfony\Component\HttpFoundation\Request —

getMasterRequest()

getMasterRequest() : \Symfony\Component\HttpFoundation\Request|null

Gets the master request.

Returns

\Symfony\Component\HttpFoundation\Request|null —

getParentRequest()

getParentRequest() : \Symfony\Component\HttpFoundation\Request|null

Returns the parent request of the current.

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.

Returns

\Symfony\Component\HttpFoundation\Request|null —

getSession()

getSession() : \Symfony\Component\HttpFoundation\Session\SessionInterface

Gets the current session.

Throws

\Symfony\Component\HttpFoundation\Exception\SessionNotFoundException

Returns

\Symfony\Component\HttpFoundation\Session\SessionInterface —