I have a custom page defined in routing with it's ControllerBase class. I want to override the whole page.html.twig for this page.
If I use hook_theme and define there 'page__test' => [...] it overrides page with my page--test.html.twig, but I don't have variables from ControllerBase class.
To override the whole
page.html.twigtemplate for your custom page you can use the following approach:hook_theme_suggestions_HOOK_alterto suggest a custom template for your page:page--test.html.twigin your theme or module's templates directory, in this file you can access variables fromControllerBaseclass: