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

__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.

Details

__construct(AppManager $app, ConfigurationManager $config, CsrfTokenService $csrfTokenService, UserContextService $userContextService, Closure $hasPermission, Closure $getDebugQueries, bool $wideLayout)

No description

Parameters

AppManager $app
ConfigurationManager $config
CsrfTokenService $csrfTokenService
UserContextService $userContextService
Closure $hasPermission
Closure $getDebugQueries
bool $wideLayout

void renderHeader(array $requestData, string $pageTitle, array|null $systemMessages = null, array|null $scriptMessages = null)

Renders the header of the page.

Parameters

array $requestData

The controller's request data (current page, form state)

string $pageTitle

Page title, or '' to fall back to the interface title

array|null $systemMessages

System messages to be displayed

array|null $scriptMessages

Return Value

void

void renderFooter()

Renders the footer of the page.

Return Value

void

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.

Return Value

array

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.

Parameters

string $activeLocale

Return Value

array

string resolveActiveLocale()

Returns the locale the translator was built with, so rendered strings and the page's lang metadata always agree.

Return Value

string