PageRendererBackendSetupTrait

This is an internal helper trait to DRY basic PageRenderer backend setup code in the backend. It configures the PageRenderer for general backend use (charset, favicon, ...).

Most prominent use is ModuleTemplate - The View used to render backend modules that have doc headers. It's also used in controllers that render backend things that have no doc header: For instance the login, the main frame and link handlers - the iframes within modals. The PageRenderer in general is more on the "maybe we can get rid of it soon" side. This trait exists to simplify a possible refactoring. In general, controllers should strive to do as little PageRenderer calls as possible and move existing calls to templates using f:be.pageRenderer ViewHelper. This will simplify substituting PageRenderer with a slim dedicated backend solution.

Internal

helper. Do not use in extensions.

Table of Contents

Methods

getBackendFavicon()  : string
Retrieves configured favicon for backend with fallback.
getNormalizedParams()  : NormalizedParams
getRegisteredStylesheetFolders()  : array<string|int, mixed>
Return an array of all stylesheet directories registered via $GLOBAlS['TBE_STYLES']['skins'].
getUriForFileName()  : string
Returns the uri of a relative reference, resolves the "EXT:" prefix (way of referring to files inside extensions) and checks that the file is inside the project root of the TYPO3 installation
loadStylesheets()  : void
Load all registered stylesheets from $GLOBALS['TBE_STYLES'] "API"
setUpBasicPageRendererForBackend()  : void
Sets mandatory parameters for the PageRenderer.

Methods

getBackendFavicon()

Retrieves configured favicon for backend with fallback.

protected getBackendFavicon(ExtensionConfiguration $extensionConfiguration, ServerRequestInterface $request) : string
Parameters
$extensionConfiguration : ExtensionConfiguration
$request : ServerRequestInterface
Return values
string

getRegisteredStylesheetFolders()

Return an array of all stylesheet directories registered via $GLOBAlS['TBE_STYLES']['skins'].

protected getRegisteredStylesheetFolders() : array<string|int, mixed>
Deprecated

will be removed in TYPO3 v13.0. Use $GLOBALS['TYPO3_CONF_VARS']['BE']['stylesheets'] instead.

Return values
array<string|int, mixed>

getUriForFileName()

Returns the uri of a relative reference, resolves the "EXT:" prefix (way of referring to files inside extensions) and checks that the file is inside the project root of the TYPO3 installation

protected getUriForFileName(ServerRequestInterface $request, string $filename) : string
Parameters
$request : ServerRequestInterface
$filename : string

The input filename/filepath to evaluate

Return values
string

Returns the filename of $filename if valid, otherwise blank string.

loadStylesheets()

Load all registered stylesheets from $GLOBALS['TBE_STYLES'] "API"

protected loadStylesheets(PageRenderer $pageRenderer) : void
Parameters
$pageRenderer : PageRenderer

        
On this page

Search results