public function RequestStack::getParentRequest in Service Container 7.2
Same name and namespace in other branches
- 7 lib/Symfony/Component/HttpFoundation/RequestStack.php \Symfony\Component\HttpFoundation\RequestStack::getParentRequest()
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 master request, it returns null.
Return value
Request|null
File
- lib/
Symfony/ Component/ HttpFoundation/ RequestStack.php, line 93
Class
- RequestStack
- Request stack that controls the lifecycle of requests.
Namespace
Symfony\Component\HttpFoundationCode
public function getParentRequest() {
$pos = count($this->requests) - 2;
if (!isset($this->requests[$pos])) {
return;
}
return $this->requests[$pos];
}