protected function StaticGenerator::replaceRequestStack in Tome 8
Replaces the request stack with a static request.
Parameters
\Symfony\Component\HttpFoundation\Request $request: The new static request.
Return value
\Symfony\Component\HttpFoundation\Request[] An array of previous stack requests.
1 call to StaticGenerator::replaceRequestStack()
- StaticGenerator::requestPath in modules/
tome_static/ src/ StaticGenerator.php - Requests and exports a given path.
File
- modules/
tome_static/ src/ StaticGenerator.php, line 566
Class
- StaticGenerator
- Handles static site generation.
Namespace
Drupal\tome_staticCode
protected function replaceRequestStack(Request $request) {
$previous_stack = [];
while ($pop = $this->requestStack
->pop()) {
$previous_stack[] = $pop;
}
$this->requestStack
->push($request);
return array_reverse($previous_stack);
}