PageRenderer
class PageRenderer (View source)
Renders the shared page chrome (header, footer, Twig globals) around controller-rendered templates.
The permission and debug-query lookups arrive as closures so they stay deferred until a template actually needs them, and so this class never triggers authentication or database work on construction.
Constants
| private MIN_SESSION_KEY_LENGTH |
Shorter than the 46 characters the installer writes, so a generated key never trips the warning. |
Methods
No description
Renders the header of the page.
Renders the footer of the page.
Language selector variables for the current request, built once and shared by the header dropdown, the page body (login form's hidden userlang field), and any later render call in the same request.
Build the login-page language selector variables: the active locale, the dropdown options, and a visibility flag. Shared by the header dropdown and the login form's hidden userlang field so the chosen language survives form submission.
Returns the locale the translator was built with, so rendered strings and the page's lang metadata always agree.
Details
__construct(AppManager $app, ConfigurationManager $config, CsrfTokenService $csrfTokenService, UserContextService $userContextService, Closure $hasPermission, Closure $getDebugQueries, bool $wideLayout)
No description
void
renderHeader(array $requestData, string $pageTitle, array|null $systemMessages = null, array|null $scriptMessages = null)
Renders the header of the page.
void
renderFooter()
Renders the footer of the page.
array
languageVars()
Language selector variables for the current request, built once and shared by the header dropdown, the page body (login form's hidden userlang field), and any later render call in the same request.
array
getLanguageSelectorVars(string $activeLocale)
Build the login-page language selector variables: the active locale, the dropdown options, and a visibility flag. Shared by the header dropdown and the login form's hidden userlang field so the chosen language survives form submission.
string
resolveActiveLocale()
Returns the locale the translator was built with, so rendered strings and the page's lang metadata always agree.