function RequestStack::getMainRequest
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.
2 calls to RequestStack::getMainRequest()
- VirtualRequestStack::getMainRequest in vendor/
symfony/ http-kernel/ Debug/ VirtualRequestStack.php - Gets the main request.
- VirtualRequestStack::getMainRequest in vendor/
symfony/ http-kernel/ Debug/ VirtualRequestStack.php - Gets the main request.
1 method overrides RequestStack::getMainRequest()
- VirtualRequestStack::getMainRequest in vendor/
symfony/ http-kernel/ Debug/ VirtualRequestStack.php - Gets the main request.
File
-
vendor/
symfony/ http-foundation/ RequestStack.php, line 79
Class
- RequestStack
- Request stack that controls the lifecycle of requests.
Namespace
Symfony\Component\HttpFoundationCode
public function getMainRequest() : ?Request {
if (!$this->requests) {
return null;
}
return $this->requests[0];
}