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
$compressCss  : bool
$compressJavascript  : bool
$concatenateCss  : bool
$concatenateJavascript  : bool
$cssFiles  : array<string, array>
$cssInline  : array<string, array>
$cssLibs  : array<string, array>
$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>
$jsFooterFiles  : array
$jsFooterInline  : array
$jsFooterLibs  : 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
$resourceCompressor  : ResourceCompressor
$responseFactory  : ResponseFactoryInterface
$shortcutTag  : string
$streamFactory  : StreamFactoryInterface
$templateFile  : string
$templateService  : MarkerBasedTemplateService
$title  : string
The title of the page
$titleTag  : string
$xmlPrologAndDocType  : string

Methods

__construct()  : mixed
addBodyContent()  : mixed
Adds content to body content
addCssFile()  : mixed
Adds CSS file
addCssInlineBlock()  : mixed
Adds CSS inline code
addCssLibrary()  : mixed
Adds CSS file
addFooterData()  : mixed
Adds footer data
addHeaderData()  : mixed
Adds header data
addInlineComment()  : mixed
Adds inline HTML comment
addInlineLanguageLabel()  : mixed
Adds Javascript Inline Label. This will occur in TYPO3.lang - object The label can be used in scripts with TYPO3.lang.<key>
addInlineLanguageLabelArray()  : mixed
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()  : mixed
Gets labels to be used in JavaScript fetched from a locallang file.
addInlineSetting()  : mixed
Adds Javascript Inline Setting. This will occur in TYPO3.settings - object The label can be used in scripts with TYPO3.setting.<key>
addInlineSettingArray()  : mixed
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()  : mixed
Adds JS file
addJsFooterFile()  : mixed
Adds JS file to footer
addJsFooterInlineCode()  : mixed
Adds JS inline code to footer
addJsFooterLibrary()  : mixed
Adds JS Library to Footer. JS Library block is rendered on top of the Footer JS files.
addJsInlineCode()  : mixed
Adds JS inline code
addJsLibrary()  : mixed
Adds JS Library. JS Library block is rendered on top of the JS files.
disableCompressCss()  : mixed
Disables compression of css
disableCompressJavascript()  : mixed
Disables compression of javascript
disableConcatenateCss()  : mixed
Disables concatenation of css files
disableConcatenateJavascript()  : mixed
Disables concatenation of js files
disableMoveJsFromHeaderToFooter()  : mixed
Disables MoveJsFromHeaderToFooter
enableCompressCss()  : mixed
Enables compression of css
enableCompressJavascript()  : mixed
Enables compression of javascript
enableConcatenateCss()  : mixed
Enables concatenation of css files
enableConcatenateJavascript()  : mixed
Enables concatenation of js files
enableMoveJsFromHeaderToFooter()  : mixed
Enables MoveJsFromHeaderToFooter
getApplicationType()  : string
String 'FE' if in FrontendApplication, 'BE' otherwise (also in CLI without request object)
getBodyContent()  : string
Gets content for body
getCompressCss()  : bool
Gets compress of css
getCompressJavascript()  : bool
Gets compress of javascript
getConcatenateCss()  : bool
Gets concatenate of css files
getConcatenateJavascript()  : bool
Gets concatenate of js files
getDocType()  : DocType
getFavIcon()  : string
Gets favicon
getHeadTag()  : string
Gets head tag
getHtmlTag()  : string
Gets html tag
getIconMimeType()  : string
Gets icon mime type
getInlineLanguageLabelFiles()  : array
Gets the inline language files
getInlineLanguageLabels()  : array
Gets the inline language labels.
getJavaScriptRenderer()  : JavaScriptRenderer
getLanguage()  : string
Gets the language
getMetaTag()  : array
Returns the requested meta tag
getMoveJsFromHeaderToFooter()  : bool
Gets MoveJsFromHeaderToFooter
getState()  : array
getTemplateFile()  : string
Gets template file
getTitle()  : string
Gets the title
loadJavaScriptModule()  : mixed
Includes an ES6/ES11 compatible JavaScript module by resolving the specifier to an import-mapped filename.
removeMetaTag()  : mixed
Unset the requested meta tag
render()  : string
Render the page
renderJavaScriptAndCssForProcessingOfUncachedContentObjects()  : string
Renders the JavaScript and CSS files that have been added during processing of uncached content objects (USER_INT, COA_INT)
renderPageWithUncachedObjects()  : string
Render the page but not the JavaScript and CSS Files
renderResponse()  : ResponseInterface
setApplyNonceHint()  : void
setBodyContent()  : mixed
Sets Content for Body
setDocType()  : void
setFavIcon()  : mixed
Sets favicon
setHeadTag()  : mixed
Sets HTML head tag
setHtmlTag()  : mixed
Sets html tag
setIconMimeType()  : mixed
Sets icon mime type
setLanguage()  : void
Sets language
setMetaTag()  : mixed
Sets a given meta tag
setNonce()  : void
setTemplateFile()  : mixed
Sets template file
setTitle()  : mixed
Sets the title
setXmlPrologAndDocType()  : mixed
Sets xml prolog and docType
updateState()  : void
addAjaxUrlsToInlineSettings()  : mixed
Make URLs to all backend ajax handlers available as inline setting.
addGlobalCSSUrlsToInlineSettings()  : mixed
createInlineCssTagFromFile()  : string
Creates a CSS inline tag
doCompress()  : mixed
Compresses inline code
doCompressCss()  : mixed
Compresses CSS according to configuration. Only possible in TYPO3 Frontend.
doCompressJavaScript()  : mixed
Compresses JavaScript according to configuration. Only possible in TYPO3 Frontend.
doConcatenate()  : mixed
Concatenate files into one file registered handler
doConcatenateCss()  : mixed
Concatenate CSS files according to configuration. Only possible in TYPO3 Frontend.
doConcatenateJavaScript()  : mixed
Concatenate JavaScript files according to the configuration. Only possible in TYPO3 Frontend.
executePostRenderHook()  : mixed
Execute postRenderHook for possible manipulation
executePreRenderHook()  : mixed
Execute PreRenderHook for possible manipulation
executeRenderPostTransformHook()  : mixed
PostTransform for possible manipulation of concatenated and compressed files
getAbsoluteWebPath()  : string
Gets absolute web path of filename for backend disposal.
getPreparedMarkerArray()  : array
Fills the marker array with the given strings and trims each value
getPreparedMarkerArrayForPageWithUncachedObjects()  : array
Fills the marker array with the given strings and trims each value
getStreamlinedFileName()  : 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
includeLanguageFileForInline()  : mixed
Include language file for inline usage
loadJavaScriptLanguageStrings()  : mixed
Load the language strings into JavaScript
parseLanguageLabelsForJavaScript()  : array
Converts the language labels for usage in JavaScript
prepareRendering()  : mixed
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()  : array|string[]
Render JavaScript libraries
renderCssFiles()  : string
Render CSS files
renderCssInline()  : string
Render inline CSS
renderCssLibraries()  : string
Render CSS library files
renderInlineJavaScript()  : array|string[]
Render inline JavaScript (must not apply `nonce="..."` if defined).
renderJavaScriptAndCss()  : array|string[]
Renders all JavaScript and CSS
renderJavaScriptFiles()  : array|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
reset()  : void
Reset all vars to initial values
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 = ''

$compressCss

protected bool $compressCss = false

$compressJavascript

protected bool $compressJavascript = false

$concatenateCss

protected bool $concatenateCss = false

$concatenateJavascript

protected bool $concatenateJavascript = false

$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 = []

$jsFooterFiles

protected array $jsFooterFiles = []

$jsFooterInline

protected array $jsFooterInline = []

$jsFooterLibs

protected array $jsFooterLibs = []

$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 = ''

$title

The title of the page

protected string $title = ''

$titleTag

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

$xmlPrologAndDocType

protected string $xmlPrologAndDocType = ''

Methods

__construct()

public __construct(FrontendInterface $assetsCache, MarkerBasedTemplateService $templateService, MetaTagManagerRegistry $metaTagRegistry, AssetRenderer $assetRenderer, AssetCollector $assetCollector, ResourceCompressor $resourceCompressor, RelativeCssPathFixer $relativeCssPathFixer, LanguageServiceFactory $languageServiceFactory, ResponseFactoryInterface $responseFactory, StreamFactoryInterface $streamFactory, IconRegistry $iconRegistry) : mixed

Parameters

$assetsCache : FrontendInterface
$templateService : MarkerBasedTemplateService
$metaTagRegistry : MetaTagManagerRegistry
$assetRenderer : AssetRenderer
$assetCollector : AssetCollector
$resourceCompressor : ResourceCompressor
$relativeCssPathFixer : RelativeCssPathFixer
$languageServiceFactory : LanguageServiceFactory
$responseFactory : ResponseFactoryInterface
$streamFactory : StreamFactoryInterface
$iconRegistry : IconRegistry

addBodyContent()

Adds content to body content

public addBodyContent(string $content) : mixed

Parameters

$content : string

addCssFile()

Adds CSS file

public addCssFile(string $file[, string $rel = 'stylesheet' ][, string $media = 'all' ][, string $title = '' ][, bool $compress = true ][, bool $forceOnTop = false ][, string $allWrap = '' ][, bool $excludeFromConcatenation = false ][, string $splitChar = '|' ][, bool $inline = false ][, array<string, string> $tagAttributes = [] ]) : mixed

Parameters

$file : string
$rel : string = 'stylesheet'
$media : string = 'all'
$title : string = ''
$compress : bool = true
$forceOnTop : bool = false
$allWrap : string = ''
$excludeFromConcatenation : bool = false
$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

addCssInlineBlock()

Adds CSS inline code

public addCssInlineBlock(string $name, string $block[, bool $compress = false ][, bool $forceOnTop = false ][, bool $useNonce = false ]) : mixed

Parameters

$name : string
$block : string
$compress : bool = false
$forceOnTop : bool = false
$useNonce : bool = false

addCssLibrary()

Adds CSS file

public addCssLibrary(string $file[, string $rel = 'stylesheet' ][, string $media = 'all' ][, string $title = '' ][, bool $compress = true ][, bool $forceOnTop = false ][, string $allWrap = '' ][, bool $excludeFromConcatenation = false ][, string $splitChar = '|' ][, bool $inline = false ][, array<string, string> $tagAttributes = [] ]) : mixed

Parameters

$file : string
$rel : string = 'stylesheet'
$media : string = 'all'
$title : string = ''
$compress : bool = true
$forceOnTop : bool = false
$allWrap : string = ''
$excludeFromConcatenation : bool = false
$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

addFooterData()

Adds footer data

public addFooterData(string $data) : mixed

Parameters

$data : string

Free header data for HTML header

addHeaderData()

Adds header data

public addHeaderData(string $data) : mixed

Parameters

$data : string

Free header data for HTML header

addInlineComment()

Adds inline HTML comment

public addInlineComment(string $comment) : mixed

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>

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

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) : mixed

Parameters

$array : array

addInlineLanguageLabelFile()

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

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

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 $namespace, string $key, mixed $value) : mixed

Parameters

$namespace : string
$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) : mixed

Parameters

$namespace : string
$array : array

addJsFile()

Adds JS file

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

Parameters

$file : string

File name

$type : string|null = ''

Content Type

$compress : bool = true
$forceOnTop : bool = false
$allWrap : string = ''
$excludeFromConcatenation : bool = false
$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 $file[, string|null $type = '' ][, bool $compress = true ][, bool $forceOnTop = false ][, string $allWrap = '' ][, bool $excludeFromConcatenation = false ][, string $splitChar = '|' ][, bool $async = false ][, string $integrity = '' ][, bool $defer = false ][, string $crossorigin = '' ][, bool $nomodule = false ][, array<string, string> $tagAttributes = [] ]) : mixed

Parameters

$file : string

File name

$type : string|null = ''

Content Type

$compress : bool = true
$forceOnTop : bool = false
$allWrap : string = ''
$excludeFromConcatenation : bool = false
$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

public addJsFooterInlineCode(string $name, string $block[, bool $compress = true ][, bool $forceOnTop = false ][, bool $useNonce = false ]) : mixed

Parameters

$name : string
$block : string
$compress : bool = true
$forceOnTop : bool = false
$useNonce : 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 $file[, string|null $type = '' ][, bool $compress = false ][, bool $forceOnTop = false ][, string $allWrap = '' ][, bool $excludeFromConcatenation = false ][, string $splitChar = '|' ][, bool $async = false ][, string $integrity = '' ][, bool $defer = false ][, string $crossorigin = '' ][, bool $nomodule = false ][, array<string, string> $tagAttributes = [] ]) : mixed

Parameters

$name : string

Arbitrary identifier

$file : string

File name

$type : string|null = ''

Content Type

$compress : bool = false

Flag if library should be compressed

$forceOnTop : bool = false

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

$allWrap : string = ''
$excludeFromConcatenation : bool = false
$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

public addJsInlineCode(string $name, string $block[, bool $compress = true ][, bool $forceOnTop = false ][, bool $useNonce = false ]) : mixed

Parameters

$name : string
$block : string
$compress : bool = true
$forceOnTop : bool = false
$useNonce : bool = false

addJsLibrary()

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

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

Parameters

$name : string

Arbitrary identifier

$file : string

File name

$type : string|null = ''

Content Type

$compress : bool = false

Flag if library should be compressed

$forceOnTop : bool = false

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

$allWrap : string = ''
$excludeFromConcatenation : bool = false
$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

disableCompressCss()

Disables compression of css

public disableCompressCss() : mixed

disableCompressJavascript()

Disables compression of javascript

public disableCompressJavascript() : mixed

disableConcatenateCss()

Disables concatenation of css files

public disableConcatenateCss() : mixed

disableConcatenateJavascript()

Disables concatenation of js files

public disableConcatenateJavascript() : mixed

disableMoveJsFromHeaderToFooter()

Disables MoveJsFromHeaderToFooter

public disableMoveJsFromHeaderToFooter() : mixed

enableCompressCss()

Enables compression of css

public enableCompressCss() : mixed

enableCompressJavascript()

Enables compression of javascript

public enableCompressJavascript() : mixed

enableConcatenateCss()

Enables concatenation of css files

public enableConcatenateCss() : mixed

enableConcatenateJavascript()

Enables concatenation of js files

public enableConcatenateJavascript() : mixed

enableMoveJsFromHeaderToFooter()

Enables MoveJsFromHeaderToFooter

public enableMoveJsFromHeaderToFooter() : mixed

getApplicationType()

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

public getApplicationType() : string

Return values

string

getBodyContent()

Gets content for body

public getBodyContent() : string

Return values

string

getCompressCss()

Gets compress of css

public getCompressCss() : bool

Return values

bool

getCompressJavascript()

Gets compress of javascript

public getCompressJavascript() : bool

Return values

bool

getConcatenateCss()

Gets concatenate of css files

public getConcatenateCss() : bool

Return values

bool

getConcatenateJavascript()

Gets concatenate of js files

public getConcatenateJavascript() : bool

Return values

bool

getFavIcon()

Gets favicon

public getFavIcon() : string

Return values

string —

$favIcon

getHeadTag()

Gets head tag

public getHeadTag() : string

Return values

string —

$tag Head tag

getHtmlTag()

Gets html tag

public getHtmlTag() : string

Return values

string —

$htmlTag Html tag

getIconMimeType()

Gets icon mime type

public getIconMimeType() : string

Return values

string —

$iconMimeType

getInlineLanguageLabelFiles()

Gets the inline language files

public getInlineLanguageLabelFiles() : array

Return values

array

getInlineLanguageLabels()

Gets the inline language labels.

public getInlineLanguageLabels() : array

Return values

array —

The inline language labels

getLanguage()

Gets the language

public getLanguage() : string

Return values

string

getMetaTag()

Returns the requested meta tag

public getMetaTag(string $type, string $name) : array

Parameters

$type : string
$name : string

Return values

array

getMoveJsFromHeaderToFooter()

Gets MoveJsFromHeaderToFooter

public getMoveJsFromHeaderToFooter() : bool

Return values

bool

getState()

public getState() : array

Return values

array

getTemplateFile()

Gets template file

public getTemplateFile() : string

Return values

string

getTitle()

Gets the title

public getTitle() : string

Return values

string —

$title Title of webpage

loadJavaScriptModule()

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

public loadJavaScriptModule(string $specifier) : mixed

Parameters

$specifier : string

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

removeMetaTag()

Unset the requested meta tag

public removeMetaTag(string $type, string $name) : mixed

Parameters

$type : string
$name : string

render()

Render the page

public render() : string

Return values

string —

Content of rendered page

renderJavaScriptAndCssForProcessingOfUncachedContentObjects()

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

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

Parameters

$cachedPageContent : string
$substituteHash : string

The hash that is used for the variables

Return values

string

renderPageWithUncachedObjects()

Render the page but not the JavaScript and CSS Files

public renderPageWithUncachedObjects(string $substituteHash) : string

Parameters

$substituteHash : string

The hash that is used for the placeholder markers

Return values

string —

Content of rendered page

renderResponse()

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

Parameters

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

Return values

ResponseInterface

setApplyNonceHint()

public setApplyNonceHint(bool $applyNonceHint) : void

Parameters

$applyNonceHint : bool

setBodyContent()

Sets Content for Body

public setBodyContent(string $content) : mixed

Parameters

$content : string

setFavIcon()

Sets favicon

public setFavIcon(string $favIcon) : mixed

Parameters

$favIcon : string

setHeadTag()

Sets HTML head tag

public setHeadTag(string $headTag) : mixed

Parameters

$headTag : string

HTML head tag

setHtmlTag()

Sets html tag

public setHtmlTag(string $htmlTag) : mixed

Parameters

$htmlTag : string

Html tag

setIconMimeType()

Sets icon mime type

public setIconMimeType(string $iconMimeType) : mixed

Parameters

$iconMimeType : string

setMetaTag()

Sets a given meta tag

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

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

Tags

throws
InvalidArgumentException

setTemplateFile()

Sets template file

public setTemplateFile(string $file) : mixed

Parameters

$file : string

setTitle()

Sets the title

public setTitle(string $title) : mixed

Parameters

$title : string

title of webpage

setXmlPrologAndDocType()

Sets xml prolog and docType

public setXmlPrologAndDocType(string $xmlPrologAndDocType) : mixed

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 ]) : mixed

Parameters

$publicRoutesOnly : bool = false

addGlobalCSSUrlsToInlineSettings()

protected addGlobalCSSUrlsToInlineSettings() : mixed

createInlineCssTagFromFile()

Creates a CSS inline tag

protected createInlineCssTagFromFile(string $file, array $properties) : string

Parameters

$file : string

the filename to process

$properties : array

Return values

string

doCompress()

Compresses inline code

protected doCompress() : mixed

doCompressCss()

Compresses CSS according to configuration. Only possible in TYPO3 Frontend.

protected doCompressCss() : mixed

doCompressJavaScript()

Compresses JavaScript according to configuration. Only possible in TYPO3 Frontend.

protected doCompressJavaScript() : mixed

doConcatenate()

Concatenate files into one file registered handler

protected doConcatenate() : mixed

doConcatenateCss()

Concatenate CSS files according to configuration. Only possible in TYPO3 Frontend.

protected doConcatenateCss() : mixed

doConcatenateJavaScript()

Concatenate JavaScript files according to the configuration. Only possible in TYPO3 Frontend.

protected doConcatenateJavaScript() : mixed

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) : mixed

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() : mixed

executeRenderPostTransformHook()

PostTransform for possible manipulation of concatenated and compressed files

protected executeRenderPostTransformHook() : mixed

getAbsoluteWebPath()

Gets absolute web path of filename for backend disposal.

protected getAbsoluteWebPath(string $file) : string

Resolving the absolute path in the frontend with conflict with applying config.absRefPrefix in frontend rendering process.

Parameters

$file : string

Tags

see
TypoScriptFrontendController::setAbsRefPrefix()

Return values

string

getPreparedMarkerArray()

Fills the marker array with the given strings and trims each value

protected getPreparedMarkerArray(string $jsLibs, string $jsFiles, string $jsFooterFiles, string $cssLibs, string $cssFiles, string $jsInline, string $cssInline, string $jsFooterInline, string $jsFooterLibs, string $metaTags) : array

Parameters

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

Return values

array —

Marker array

getPreparedMarkerArrayForPageWithUncachedObjects()

Fills the marker array with the given strings and trims each value

protected getPreparedMarkerArrayForPageWithUncachedObjects(string $substituteHash) : array

Parameters

$substituteHash : string

The hash that is used for the placeholder markers

Return values

array —

Marker array

getStreamlinedFileName()

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 getStreamlinedFileName(string $file[, bool $prepareForOutput = true ]) : 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.

Parameters

$file : string

the filename to process

$prepareForOutput : bool = true

whether the file should be prepared as version numbered file and prefixed as absolute webpath

Return values

string

getTemplate()

Reads the template file and returns the requested part as string

protected getTemplate() : string

Return values

string

includeLanguageFileForInline()

Include language file for inline usage

protected includeLanguageFileForInline(string $fileRef[, string $selectionPrefix = '' ][, string $stripFromSelectionName = '' ]) : mixed

Parameters

$fileRef : string
$selectionPrefix : string = ''
$stripFromSelectionName : string = ''

loadJavaScriptLanguageStrings()

Load the language strings into JavaScript

protected loadJavaScriptLanguageStrings() : mixed

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() : mixed

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() : array|string[]

Return values

array|string[] —

jsLibs and jsFooterLibs strings

renderCssFiles()

Render CSS files

protected renderCssFiles() : string

Return values

string

renderCssInline()

Render inline CSS

protected renderCssInline() : string

Return values

string

renderCssLibraries()

Render CSS library files

protected renderCssLibraries() : string

Return values

string

renderInlineJavaScript()

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

protected renderInlineJavaScript() : array|string[]

Return values

array|string[] —

jsInline and jsFooterInline string

renderJavaScriptAndCss()

Renders all JavaScript and CSS

protected renderJavaScriptAndCss() : array|string[]

Return values

array|string[]

renderJavaScriptFiles()

Render JavaScript files

protected renderJavaScriptFiles() : array|string[]

Return values

array|string[] —

jsFiles and jsFooterFiles strings

renderMainJavaScriptLibraries()

Helper function for render the main JavaScript libraries

protected renderMainJavaScriptLibraries() : string

Return values

string —

Content with JavaScript libraries

renderMetaTagsFromAPI()

Renders metaTags based on tags added via the API

protected renderMetaTagsFromAPI() : array

Return values

array

reset()

Reset all vars to initial values

protected reset() : void

setDefaultHtmlTag()

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

protected setDefaultHtmlTag() : void

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