PageRenderer

class \TYPO3\CMS\Core\Page\PageRenderer

Implements
SingletonInterface

TYPO3 pageRender class This class render the HTML of a webpage, usable for BE and FE

Table of Contents

Interfaces

SingletonInterface
"empty" interface for singletons (marker interface pattern)

Constants

PART_COMPLETE  : mixed = 0
PART_FOOTER  : mixed = 2
PART_HEADER  : mixed = 1

Properties

$applyNonceHint  : bool
$assetCollector  : AssetCollector
$assetRenderer  : AssetRenderer
$assetsCache  : FrontendInterface
$bodyContent  : string
$context  : Context
$cssFiles  : array<string, array>
$cssInline  : array<string, array>
$cssLibs  : array<string, array>
$directiveHashCollection  : DirectiveHashCollection
$docType  : DocType
$endingSlash  : string
Is empty string for HTML and ' /' for XHTML rendering
$favIcon  : string
$footerData  : array
$headerData  : array
$headTag  : string
$htmlTag  : string
$iconMimeType  : string
$iconRegistry  : IconRegistry
$inlineComments  : array
$inlineLanguageLabelFiles  : array
$inlineLanguageLabels  : array
$inlineSettings  : array
$javaScriptRenderer  : JavaScriptRenderer
$jsFiles  : array<string, array>
$jsInline  : array<string, array>
$jsLibs  : array
$languageServiceFactory  : LanguageServiceFactory
$locale  : Locale
The locale, used for the <html> tag (depending on the DocType) and possible translation files.
$metaTagRegistry  : MetaTagManagerRegistry
$moveJsFromHeaderToFooter  : bool
$nonce  : ConsumableNonce|null
$relativeCssPathFixer  : RelativeCssPathFixer
$resourceHashCollection  : ResourceHashCollection
$resourcePublisher  : SystemResourcePublisherInterface
$responseFactory  : ResponseFactoryInterface
$shortcutTag  : string
$streamFactory  : StreamFactoryInterface
$systemResourceFactory  : SystemResourceFactory
$templateFile  : string
$templateService  : MarkerBasedTemplateService
$title  : string
$titleTag  : string
$xmlPrologAndDocType  : string

Methods

__construct()  : mixed
addBodyContent()  : void
Adds content to body content
addCssFile()  : void
Adds CSS file
addCssInlineBlock()  : void
Adds CSS inline code
addCssLibrary()  : void
Adds CSS library
addFooterData()  : void
Adds footer data
addHeaderData()  : void
Adds header data
addInlineComment()  : void
Adds inline HTML comment.
addInlineLanguageLabel()  : void
Adds Javascript Inline Label. This will occur in TYPO3.lang - object The label can be used in scripts with TYPO3.lang.<key> BE only.
addInlineLanguageLabelArray()  : void
Adds Javascript Inline Label Array. This will occur in TYPO3.lang - object The label can be used in scripts with TYPO3.lang.<key> Array will be merged with existing array.
addInlineLanguageLabelFile()  : void
Gets labels to be used in JavaScript fetched from a locallang file.
addInlineSetting()  : void
Adds Javascript Inline Setting. This will occur in TYPO3.settings - object The label can be used in scripts with TYPO3.setting.<key>
addInlineSettingArray()  : void
Adds Javascript Inline Setting. This will occur in TYPO3.settings - object The label can be used in scripts with TYPO3.setting.<key> Array will be merged with existing array.
addJsFile()  : void
Adds JS file
addJsFooterFile()  : void
Adds JS file to footer
addJsFooterInlineCode()  : void
Adds JS inline code to footer FE only.
addJsFooterLibrary()  : void
Adds JS Library to Footer. JS Library block is rendered on top of the Footer JS files.
addJsInlineCode()  : void
Adds JS inline code FE only.
addJsLibrary()  : void
Adds JS Library. JS Library block is rendered on top of the JS files.
disableMoveJsFromHeaderToFooter()  : void
FE only, unused.
enableMoveJsFromHeaderToFooter()  : void
FE only
getJavaScriptRenderer()  : JavaScriptRenderer
BE only, FE uses a different approach to register JS
getState()  : array
loadJavaScriptModule()  : void
Includes an ES6/ES11 compatible JavaScript module by resolving the specifier to an import-mapped filename.
render()  : string
Render the page.
renderFrontendPage()  : string
Render the page for frontend output.
renderJavaScriptAndCssForProcessingOfUncachedContentObjects()  : string
Renders the JavaScript and CSS files that have been added during processing of uncached content objects (USER_INT, COA_INT) FE only.
renderPageWithUncachedObjects()  : string
Frontend related rendering of the main page HTML scaffold with placeholders for dynamic sections finished by uncached element ("INT") processing later.
renderResponse()  : ResponseInterface
BE only.
reset()  : void
Reset all vars to initial values
setApplyNonceHint()  : void
BE only?
setBodyContent()  : void
Sets Content for Body BE only, FE uses addBodyContent
setDocType()  : void
FE only, BE is hard coded HTML5
setFavIcon()  : void
Sets favicon
setHeadTag()  : void
Sets HTML head tag FE only.
setHtmlTag()  : void
Sets html tag FE only, BE is hard coded html5.
setIconMimeType()  : void
Sets icon mime type
setLanguage()  : void
Sets language
setMetaTag()  : void
Sets a given meta tag
setNonce()  : void
setTemplateFile()  : void
Sets template file FE only.
setTitle()  : void
Content of <title> tag in <html><head>
setXmlPrologAndDocType()  : void
Sets xml prolog and docType.
updateState()  : void
addAjaxUrlsToInlineSettings()  : void
Make URLs to all backend ajax handlers available as inline setting.
addGlobalCSSUrlsToInlineSettings()  : void
createInlineCssTagFromFile()  : string
Creates a CSS inline tag
executePostRenderHook()  : void
Execute postRenderHook for possible manipulation
executePreRenderHook()  : void
Execute PreRenderHook for possible manipulation
executeRenderPostTransformHook()  : void
PostTransform for possible manipulation of concatenated and compressed files
getApplicationType()  : string
String 'FE' if in FrontendApplication, 'BE' otherwise (also in CLI without request object)
getPublicUrlForFile()  : string
This function acts as a wrapper to allow relative and paths starting with EXT: to be dealt with in this very case to always return the "absolute web path" to be included directly before output.
getTemplate()  : string
Reads the template file and returns the requested part as string
loadJavaScriptLanguageStrings()  : void
Load the language strings into JavaScript
parseLanguageLabelsForJavaScript()  : array
Converts the language labels for usage in JavaScript
prepareRendering()  : void
Remove ending slashes from static header block if the page is being rendered as html (not xhtml) and define property $this->endingSlash for further use
readLLfile()  : array
Reads a locallang file.
renderAdditionalJavaScriptLibraries()  : string[]
Render JavaScript libraries
renderCssFiles()  : string
Render CSS files
renderCssInline()  : string
Render inline CSS
renderCssLibraries()  : string
Render CSS library files
renderInlineJavaScript()  : string[]
Render inline JavaScript (must not apply `nonce="..."` if defined).
renderJavaScriptAndCss()  : string[]
Renders all JavaScript and CSS
renderJavaScriptFiles()  : string[]
Render JavaScript files
renderMainJavaScriptLibraries()  : string
Helper function for render the main JavaScript libraries
renderMetaTagsFromAPI()  : array
Renders metaTags based on tags added via the API
setDefaultHtmlTag()  : void
Internal method to set a basic <html> tag when in HTML5 with the proper language/locale and "dir" attributes.
wrapInlineScript()  : string
wrapInlineStyle()  : string

Constants

PART_COMPLETE

protected mixed PART_COMPLETE = 0
protected mixed PART_FOOTER = 2

PART_HEADER

protected mixed PART_HEADER = 1

Properties

$applyNonceHint

protected bool $applyNonceHint = false

$bodyContent

protected string $bodyContent = ''

$cssFiles

protected array<string, array> $cssFiles = []

$cssInline

protected array<string, array> $cssInline = []

$cssLibs

protected array<string, array> $cssLibs = []

$endingSlash

Is empty string for HTML and ' /' for XHTML rendering

protected string $endingSlash = ''

$footerData

protected array $footerData = []

$headerData

protected array $headerData = []

$headTag

protected string $headTag = '<head>'

$htmlTag

protected string $htmlTag = '<html>'

$iconMimeType

protected string $iconMimeType = ''

$inlineComments

protected array $inlineComments = []

$inlineLanguageLabelFiles

protected array $inlineLanguageLabelFiles = []

$inlineLanguageLabels

protected array $inlineLanguageLabels = []

$inlineSettings

protected array $inlineSettings = []

$jsFiles

protected array<string, array> $jsFiles = []

$jsInline

protected array<string, array> $jsInline = []

$locale

The locale, used for the <html> tag (depending on the DocType) and possible translation files.

protected Locale $locale

$moveJsFromHeaderToFooter

protected bool $moveJsFromHeaderToFooter = false

$responseFactory read-only

protected ResponseFactoryInterface $responseFactory

$shortcutTag

protected string $shortcutTag = '<link rel="icon" href="%1$s"%2$s />'

$streamFactory read-only

protected StreamFactoryInterface $streamFactory

$templateFile

protected string $templateFile = 'PKG:typo3/cms-core:Resources/Private/Templates/PageRenderer.html'

$titleTag

protected string $titleTag = '<title>|</title>'

$xmlPrologAndDocType

protected string $xmlPrologAndDocType = ''

Methods

__construct()

public __construct(Context $context, FrontendInterface $assetsCache, MarkerBasedTemplateService $templateService, MetaTagManagerRegistry $metaTagRegistry, AssetRenderer $assetRenderer, AssetCollector $assetCollector, RelativeCssPathFixer $relativeCssPathFixer, LanguageServiceFactory $languageServiceFactory, ResponseFactoryInterface $responseFactory, StreamFactoryInterface $streamFactory, IconRegistry $iconRegistry, SystemResourcePublisherInterface $resourcePublisher, SystemResourceFactory $systemResourceFactory, ResourceHashCollection $resourceHashCollection, DirectiveHashCollection $directiveHashCollection) : mixed

Parameters

$context : Context
$assetsCache : FrontendInterface
$templateService : MarkerBasedTemplateService
$metaTagRegistry : MetaTagManagerRegistry
$assetRenderer : AssetRenderer
$assetCollector : AssetCollector
$relativeCssPathFixer : RelativeCssPathFixer
$languageServiceFactory : LanguageServiceFactory
$responseFactory : ResponseFactoryInterface
$streamFactory : StreamFactoryInterface
$iconRegistry : IconRegistry
$resourcePublisher : SystemResourcePublisherInterface
$systemResourceFactory : SystemResourceFactory
$resourceHashCollection : ResourceHashCollection
$directiveHashCollection : DirectiveHashCollection

addBodyContent()

Adds content to body content

public addBodyContent(string $content) : void

Parameters

$content : string

addCssFile()

Adds CSS file

public addCssFile(string|StaticResourceInterface $file[, string $rel = 'stylesheet' ][, string $media = 'all' ][, string $title = '' ][, mixed $_ = null ][, bool $forceOnTop = false ][, string $allWrap = '' ][, mixed $__ = null ][, string $splitChar = '|' ][, bool $inline = false ][, array<string, string> $tagAttributes = [] ][, string $integrity = '' ][, string $crossorigin = '' ]) : void

Parameters

$file : string|StaticResourceInterface
$rel : string = 'stylesheet'
$media : string = 'all'
$title : string = ''
$_ : mixed = null
$forceOnTop : bool = false
$allWrap : string = ''
$__ : mixed = null
$splitChar : string = '|'

The char used to split the allWrap value, default is "|"

$inline : bool = false
$tagAttributes : array<string, string> = []

Key => value list of tag attributes

$integrity : string = ''

Subresource Integrity (SRI)

$crossorigin : string = ''

CORS settings attribute

addCssInlineBlock()

Adds CSS inline code

public addCssInlineBlock(string $name, string $block[, mixed $_ = null ][, bool $forceOnTop = false ][, bool $csp = false ]) : void

Parameters

$name : string
$block : string
$_ : mixed = null
$forceOnTop : bool = false
$csp : bool = false

addCssLibrary()

Adds CSS library

public addCssLibrary(string|StaticResourceInterface $file[, string $rel = 'stylesheet' ][, string $media = 'all' ][, string $title = '' ][, mixed $_ = null ][, bool $forceOnTop = false ][, string $allWrap = '' ][, mixed $__ = null ][, string $splitChar = '|' ][, bool $inline = false ][, array<string, string> $tagAttributes = [] ][, string $integrity = '' ][, string $crossorigin = '' ]) : void

Parameters

$file : string|StaticResourceInterface
$rel : string = 'stylesheet'
$media : string = 'all'
$title : string = ''
$_ : mixed = null
$forceOnTop : bool = false
$allWrap : string = ''
$__ : mixed = null
$splitChar : string = '|'

The char used to split the allWrap value, default is "|"

$inline : bool = false
$tagAttributes : array<string, string> = []

Key => value list of tag attributes

$integrity : string = ''

Subresource Integrity (SRI)

$crossorigin : string = ''

CORS settings attribute

addFooterData()

Adds footer data

public addFooterData(string $data) : void

Parameters

$data : string

Free footer data for HTML footer before closing body tag

addHeaderData()

Adds header data

public addHeaderData(string $data) : void

Parameters

$data : string

Free header data for HTML header

addInlineComment()

Adds inline HTML comment.

public addInlineComment(string $comment) : void

FE only.

Parameters

$comment : string

addInlineLanguageLabel()

Adds Javascript Inline Label. This will occur in TYPO3.lang - object The label can be used in scripts with TYPO3.lang.<key> BE only.

public addInlineLanguageLabel(string $key, string $value) : void

Parameters

$key : string
$value : string

addInlineLanguageLabelArray()

Adds Javascript Inline Label Array. This will occur in TYPO3.lang - object The label can be used in scripts with TYPO3.lang.<key> Array will be merged with existing array.

public addInlineLanguageLabelArray(array $array) : void

BE only.

Parameters

$array : array

addInlineLanguageLabelFile()

Gets labels to be used in JavaScript fetched from a locallang file.

public addInlineLanguageLabelFile(string $fileRef[, string $selectionPrefix = '' ][, string $stripFromSelectionName = '' ]) : void

Parameters

$fileRef : string

Input is a file-reference (see GeneralUtility::getFileAbsFileName). That file is expected to be a 'locallang.xlf' file containing a valid XML TYPO3 language structure.

$selectionPrefix : string = ''

Prefix to select the correct labels (default: '')

$stripFromSelectionName : string = ''

String to be removed from the label names in the output. (default: '')

addInlineSetting()

Adds Javascript Inline Setting. This will occur in TYPO3.settings - object The label can be used in scripts with TYPO3.setting.<key>

public addInlineSetting(string|null $namespace, string $key, mixed $value) : void

Parameters

$namespace : string|null
$key : string
$value : mixed

addInlineSettingArray()

Adds Javascript Inline Setting. This will occur in TYPO3.settings - object The label can be used in scripts with TYPO3.setting.<key> Array will be merged with existing array.

public addInlineSettingArray(string $namespace, array $array) : void

Parameters

$namespace : string
$array : array

addJsFile()

Adds JS file

public addJsFile(string|StaticResourceInterface $file[, string|null $type = '' ][, mixed $_ = null ][, bool $forceOnTop = false ][, string $allWrap = '' ][, mixed $__ = null ][, string $splitChar = '|' ][, bool $async = false ][, string $integrity = '' ][, bool $defer = false ][, string $crossorigin = '' ][, bool $nomodule = false ][, array<string, string> $tagAttributes = [] ]) : void

Parameters

$file : string|StaticResourceInterface

File name

$type : string|null = ''

Content Type

$_ : mixed = null
$forceOnTop : bool = false
$allWrap : string = ''
$__ : mixed = null
$splitChar : string = '|'

The char used to split the allWrap value, default is "|"

$async : bool = false

Flag if property 'async="async"' should be added to JavaScript tags

$integrity : string = ''

Subresource Integrity (SRI)

$defer : bool = false

Flag if property 'defer="defer"' should be added to JavaScript tags

$crossorigin : string = ''

CORS settings attribute

$nomodule : bool = false

Flag if property 'nomodule="nomodule"' should be added to JavaScript tags

$tagAttributes : array<string, string> = []

Key => value list of tag attributes

addJsFooterFile()

Adds JS file to footer

public addJsFooterFile(string|StaticResourceInterface $file[, string|null $type = '' ][, mixed $_ = null ][, bool $forceOnTop = false ][, string $allWrap = '' ][, mixed $__ = null ][, string $splitChar = '|' ][, bool $async = false ][, string $integrity = '' ][, bool $defer = false ][, string $crossorigin = '' ][, bool $nomodule = false ][, array<string, string> $tagAttributes = [] ]) : void

Parameters

$file : string|StaticResourceInterface

File name

$type : string|null = ''

Content Type

$_ : mixed = null
$forceOnTop : bool = false
$allWrap : string = ''
$__ : mixed = null
$splitChar : string = '|'

The char used to split the allWrap value, default is "|"

$async : bool = false

Flag if property 'async="async"' should be added to JavaScript tags

$integrity : string = ''

Subresource Integrity (SRI)

$defer : bool = false

Flag if property 'defer="defer"' should be added to JavaScript tags

$crossorigin : string = ''

CORS settings attribute

$nomodule : bool = false

Flag if property 'nomodule="nomodule"' should be added to JavaScript tags

$tagAttributes : array<string, string> = []

Key => value list of tag attributes

addJsFooterInlineCode()

Adds JS inline code to footer FE only.

public addJsFooterInlineCode(string $name, string $block[, mixed $_ = null ][, bool $forceOnTop = false ][, bool $csp = false ]) : void

Parameters

$name : string
$block : string
$_ : mixed = null
$forceOnTop : bool = false
$csp : bool = false

addJsFooterLibrary()

Adds JS Library to Footer. JS Library block is rendered on top of the Footer JS files.

public addJsFooterLibrary(string $name, string|StaticResourceInterface $file[, string|null $type = '' ][, mixed $_ = null ][, bool $forceOnTop = false ][, string $allWrap = '' ][, mixed $__ = null ][, string $splitChar = '|' ][, bool $async = false ][, string $integrity = '' ][, bool $defer = false ][, string $crossorigin = '' ][, bool $nomodule = false ][, array<string, string> $tagAttributes = [] ]) : void

Parameters

$name : string

Arbitrary identifier

$file : string|StaticResourceInterface

File name

$type : string|null = ''

Content Type

$_ : mixed = null
$forceOnTop : bool = false

Flag if added library should be inserted at begin of this block

$allWrap : string = ''
$__ : mixed = null
$splitChar : string = '|'

The char used to split the allWrap value, default is "|"

$async : bool = false

Flag if property 'async="async"' should be added to JavaScript tags

$integrity : string = ''

Subresource Integrity (SRI)

$defer : bool = false

Flag if property 'defer="defer"' should be added to JavaScript tags

$crossorigin : string = ''

CORS settings attribute

$nomodule : bool = false

Flag if property 'nomodule="nomodule"' should be added to JavaScript tags

$tagAttributes : array<string, string> = []

Key => value list of tag attributes

addJsInlineCode()

Adds JS inline code FE only.

public addJsInlineCode(string $name, string $block[, mixed $_ = null ][, bool $forceOnTop = false ][, bool $csp = false ]) : void

Parameters

$name : string
$block : string
$_ : mixed = null
$forceOnTop : bool = false
$csp : bool = false

addJsLibrary()

Adds JS Library. JS Library block is rendered on top of the JS files.

public addJsLibrary(string $name, string|StaticResourceInterface $file[, string|null $type = '' ][, mixed $_ = null ][, bool $forceOnTop = false ][, string $allWrap = '' ][, mixed $__ = null ][, string $splitChar = '|' ][, bool $async = false ][, string $integrity = '' ][, bool $defer = false ][, string $crossorigin = '' ][, bool $nomodule = false ][, array<string, string> $tagAttributes = [] ]) : void

Parameters

$name : string

Arbitrary identifier

$file : string|StaticResourceInterface

File name

$type : string|null = ''

Content Type

$_ : mixed = null
$forceOnTop : bool = false

Flag if added library should be inserted at begin of this block

$allWrap : string = ''
$__ : mixed = null
$splitChar : string = '|'

The char used to split the allWrap value, default is "|"

$async : bool = false

Flag if property 'async="async"' should be added to JavaScript tags

$integrity : string = ''

Subresource Integrity (SRI)

$defer : bool = false

Flag if property 'defer="defer"' should be added to JavaScript tags

$crossorigin : string = ''

CORS settings attribute

$nomodule : bool = false

Flag if property 'nomodule="nomodule"' should be added to JavaScript tags

$tagAttributes : array<string, string> = []

Key => value list of tag attributes

disableMoveJsFromHeaderToFooter()

FE only, unused.

public disableMoveJsFromHeaderToFooter() : void

enableMoveJsFromHeaderToFooter()

FE only

public enableMoveJsFromHeaderToFooter() : void

getState()

public getState() : array

Return values

array

loadJavaScriptModule()

Includes an ES6/ES11 compatible JavaScript module by resolving the specifier to an import-mapped filename.

public loadJavaScriptModule(string $specifier) : void

Parameters

$specifier : string

Bare module identifier like @my/package/filename.js

render()

Render the page.

public render(ServerRequestInterface $request) : string

BE only.

Parameters

$request : ServerRequestInterface

Return values

string —

Content of rendered page

renderFrontendPage()

Render the page for frontend output.

public renderFrontendPage(ServerRequestInterface $request) : string

FE only.

Parameters

$request : ServerRequestInterface

Return values

string

renderJavaScriptAndCssForProcessingOfUncachedContentObjects()

Renders the JavaScript and CSS files that have been added during processing of uncached content objects (USER_INT, COA_INT) FE only.

public renderJavaScriptAndCssForProcessingOfUncachedContentObjects(ServerRequestInterface $request, string $cachedPageContent, string $substituteHash) : string

Parameters

$request : ServerRequestInterface
$cachedPageContent : string
$substituteHash : string

The hash that is used for the variables

Return values

string

renderPageWithUncachedObjects()

Frontend related rendering of the main page HTML scaffold with placeholders for dynamic sections finished by uncached element ("INT") processing later.

public renderPageWithUncachedObjects(string $substituteHash) : string

The result of this method is cached as content in page cache. FE only.

Parameters

$substituteHash : string

The hash that is used for the placeholder markers

Return values

string

renderResponse()

BE only.

public renderResponse(ServerRequestInterface $request[, int $code = 200 ][, string $reasonPhrase = '' ]) : ResponseInterface

Parameters

$request : ServerRequestInterface
$code : int = 200
$reasonPhrase : string = ''

Return values

ResponseInterface

reset()

Reset all vars to initial values

public reset(ServerRequestInterface $request) : void

Parameters

$request : ServerRequestInterface

setApplyNonceHint()

BE only?

public setApplyNonceHint(bool $applyNonceHint) : void

Parameters

$applyNonceHint : bool

setBodyContent()

Sets Content for Body BE only, FE uses addBodyContent

public setBodyContent(string $content) : void

Parameters

$content : string

setDocType()

FE only, BE is hard coded HTML5

public setDocType(DocType $docType, ServerRequestInterface $request) : void

Parameters

$docType : DocType
$request : ServerRequestInterface

setFavIcon()

Sets favicon

public setFavIcon(string $favIcon) : void

Parameters

$favIcon : string

setHeadTag()

Sets HTML head tag FE only.

public setHeadTag(string $headTag) : void

Parameters

$headTag : string

setHtmlTag()

Sets html tag FE only, BE is hard coded html5.

public setHtmlTag(string $htmlTag) : void

Parameters

$htmlTag : string

setIconMimeType()

Sets icon mime type

public setIconMimeType(string $iconMimeType) : void

Parameters

$iconMimeType : string

setLanguage()

Sets language

public setLanguage(Locale $locale, ServerRequestInterface $request) : void

Parameters

$locale : Locale
$request : ServerRequestInterface

setMetaTag()

Sets a given meta tag

public setMetaTag(string $type, string $name, string $content[, array $subProperties = [] ][, bool $replace = true ]) : void

Parameters

$type : string

The type of the meta tag. Allowed values are property, name or http-equiv

$name : string

The name of the property to add

$content : string

The content of the meta tag

$subProperties : array = []

Subproperties of the meta tag (like e.g. og:image:width)

$replace : bool = true

Replace earlier set meta tag

setTemplateFile()

Sets template file FE only.

public setTemplateFile(string $file) : void

Parameters

$file : string

setTitle()

Content of <title> tag in <html><head>

public setTitle(string $title) : void

Parameters

$title : string

setXmlPrologAndDocType()

Sets xml prolog and docType.

public setXmlPrologAndDocType(string $xmlPrologAndDocType) : void

FE only, BE is hard coded html5.

Parameters

$xmlPrologAndDocType : string

Complete tags for xml prolog and docType

updateState()

public updateState(array $state) : void

Parameters

$state : array

addAjaxUrlsToInlineSettings()

Make URLs to all backend ajax handlers available as inline setting.

protected addAjaxUrlsToInlineSettings([bool $publicRoutesOnly = false ]) : void

Parameters

$publicRoutesOnly : bool = false

addGlobalCSSUrlsToInlineSettings()

protected addGlobalCSSUrlsToInlineSettings(ServerRequestInterface $request) : void

Parameters

$request : ServerRequestInterface

createInlineCssTagFromFile()

Creates a CSS inline tag

protected createInlineCssTagFromFile(SystemResourceInterface $resource, array $properties, ServerRequestInterface $request) : string

Parameters

$resource : SystemResourceInterface

the resource to process

$properties : array
$request : ServerRequestInterface

Return values

string

executePostRenderHook()

Execute postRenderHook for possible manipulation

protected executePostRenderHook(string &$jsLibs, string &$jsFiles, string &$jsFooterFiles, string &$cssLibs, string &$cssFiles, string &$jsInline, string &$cssInline, string &$jsFooterInline, string &$jsFooterLibs) : void

Parameters

$jsLibs : string
$jsFiles : string
$jsFooterFiles : string
$cssLibs : string
$cssFiles : string
$jsInline : string
$cssInline : string
$jsFooterInline : string
$jsFooterLibs : string

executePreRenderHook()

Execute PreRenderHook for possible manipulation

protected executePreRenderHook() : void

executeRenderPostTransformHook()

PostTransform for possible manipulation of concatenated and compressed files

protected executeRenderPostTransformHook() : void

getApplicationType()

String 'FE' if in FrontendApplication, 'BE' otherwise (also in CLI without request object)

protected getApplicationType(ServerRequestInterface $request) : string

Parameters

$request : ServerRequestInterface

Return values

string

getPublicUrlForFile()

This function acts as a wrapper to allow relative and paths starting with EXT: to be dealt with in this very case to always return the "absolute web path" to be included directly before output.

protected getPublicUrlForFile(string $file, ServerRequestInterface $request) : string

This is mainly added so the EXT: syntax can be resolved for PageRenderer in one central place, and hopefully removed in the future by one standard API call.

The file is also prepared as version numbered file and prefixed as absolute webpath

Parameters

$file : string

the filename to process

$request : ServerRequestInterface

Return values

string

getTemplate()

Reads the template file and returns the requested part as string

protected getTemplate() : string

Return values

string

loadJavaScriptLanguageStrings()

Load the language strings into JavaScript

protected loadJavaScriptLanguageStrings() : void

parseLanguageLabelsForJavaScript()

Converts the language labels for usage in JavaScript

protected parseLanguageLabelsForJavaScript() : array

Return values

array

prepareRendering()

Remove ending slashes from static header block if the page is being rendered as html (not xhtml) and define property $this->endingSlash for further use

protected prepareRendering() : void

readLLfile()

Reads a locallang file.

protected readLLfile(string $fileRef) : array

Parameters

$fileRef : string

Reference to a relative filename to include.

Return values

array —

Returns the $LOCAL_LANG array found in the file. If no array found, returns empty array.

renderAdditionalJavaScriptLibraries()

Render JavaScript libraries

protected renderAdditionalJavaScriptLibraries(ServerRequestInterface $request) : string[]

Parameters

$request : ServerRequestInterface

Return values

string[] —

jsLibs and jsFooterLibs strings

renderCssFiles()

Render CSS files

protected renderCssFiles(ServerRequestInterface $request) : string

Parameters

$request : ServerRequestInterface

Return values

string

renderCssInline()

Render inline CSS

protected renderCssInline() : string

Return values

string

renderCssLibraries()

Render CSS library files

protected renderCssLibraries(ServerRequestInterface $request) : string

Parameters

$request : ServerRequestInterface

Return values

string

renderInlineJavaScript()

Render inline JavaScript (must not apply `nonce="..."` if defined).

protected renderInlineJavaScript() : string[]

Return values

string[] —

jsInline and jsFooterInline string

renderJavaScriptAndCss()

Renders all JavaScript and CSS

protected renderJavaScriptAndCss(ServerRequestInterface $request) : string[]

Parameters

$request : ServerRequestInterface

Return values

string[]

renderJavaScriptFiles()

Render JavaScript files

protected renderJavaScriptFiles(ServerRequestInterface $request) : string[]

Parameters

$request : ServerRequestInterface

Return values

string[] —

jsFiles and jsFooterFiles strings

renderMainJavaScriptLibraries()

Helper function for render the main JavaScript libraries

protected renderMainJavaScriptLibraries(ServerRequestInterface $request) : string

Parameters

$request : ServerRequestInterface

Return values

string —

Content with JavaScript libraries

renderMetaTagsFromAPI()

Renders metaTags based on tags added via the API

protected renderMetaTagsFromAPI(DocType $docType) : array

Parameters

$docType : DocType

Return values

array

setDefaultHtmlTag()

Internal method to set a basic <html> tag when in HTML5 with the proper language/locale and "dir" attributes.

protected setDefaultHtmlTag(ServerRequestInterface $request) : void

Parameters

$request : ServerRequestInterface

wrapInlineScript()

protected wrapInlineScript(string $content[, array $attributes = [] ]) : string

Parameters

$content : string
$attributes : array = []

Return values

string

wrapInlineStyle()

protected wrapInlineStyle(string $content[, array $attributes = [] ]) : string

Parameters

$content : string
$attributes : array = []

Return values

string
On this page