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 = 0
- PART_FOOTER = 2
- PART_HEADER = 1
Properties
- $applyNonceHint : bool
- $assetRenderer : AssetRenderer
- $assetsCache : FrontendInterface
- $bodyContent : string
- $compressCss : bool
- $compressJavascript : bool
- $concatenateCss : bool
- $concatenateJavascript : bool
- $cssFiles : array<string, array<string|int, mixed>>
- $cssInline : array<string, array<string|int, mixed>>
- $cssLibs : array<string, array<string|int, mixed>>
- $docType : DocType
- $endingSlash : string
- Is empty string for HTML and ' /' for XHTML rendering
- $favIcon : string
- $footerData : array<string|int, mixed>
- $headerData : array<string|int, mixed>
- $headTag : string
- $htmlTag : string
- $iconMimeType : string
- $inlineComments : array<string|int, mixed>
- $inlineLanguageLabelFiles : array<string|int, mixed>
- $inlineLanguageLabels : array<string|int, mixed>
- $inlineSettings : array<string|int, mixed>
- $javaScriptRenderer : JavaScriptRenderer
- $jsFiles : array<string, array<string|int, mixed>>
- $jsFooterFiles : array<string|int, mixed>
- $jsFooterInline : array<string|int, mixed>
- $jsFooterLibs : array<string|int, mixed>
- $jsInline : array<string, array<string|int, mixed>>
- $jsLibs : array<string|int, mixed>
- $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<string|int, mixed>
- Gets the inline language files
- getInlineLanguageLabels() : array<string|int, mixed>
- Gets the inline language labels.
- getJavaScriptRenderer() : JavaScriptRenderer
- getLanguage() : string
- Gets the language
- getMetaTag() : array<string|int, mixed>
- Returns the requested meta tag
- getMoveJsFromHeaderToFooter() : bool
- Gets MoveJsFromHeaderToFooter
- getState() : array<string|int, mixed>
- 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<string|int, mixed>
- Fills the marker array with the given strings and trims each value
- getPreparedMarkerArrayForPageWithUncachedObjects() : array<string|int, mixed>
- 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<string|int, mixed>
- 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
- processJsFile() : string
- Processes a Javascript file dependent on the current context
- readLLfile() : array<string|int, mixed>
- Reads a locallang file.
- renderAdditionalJavaScriptLibraries() : array<string|int, mixed>|array<string|int, string>
- Render JavaScript libraries
- renderCssFiles() : string
- Render CSS files
- renderCssInline() : string
- Render inline CSS
- renderCssLibraries() : string
- Render CSS library files
- renderInlineJavaScript() : array<string|int, mixed>|array<string|int, string>
- Render inline JavaScript (must not apply `nonce="..."` if defined).
- renderJavaScriptAndCss() : array<string|int, mixed>|array<string|int, string>
- Renders all JavaScript and CSS
- renderJavaScriptFiles() : array<string|int, mixed>|array<string|int, string>
- Render JavaScript files
- renderMainJavaScriptLibraries() : string
- Helper function for render the main JavaScript libraries
- renderMetaTagsFromAPI() : array<string|int, mixed>
- 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
PART_FOOTER
protected
mixed
PART_FOOTER
= 2
PART_HEADER
protected
mixed
PART_HEADER
= 1
Properties
$applyNonceHint
protected
bool
$applyNonceHint
= false
$assetRenderer read-only
protected
AssetRenderer
$assetRenderer
$assetsCache read-only
protected
FrontendInterface
$assetsCache
Attributes
- #[Autowire]
- $service: 'cache.assets'
$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<string|int, mixed>>
$cssFiles
= []
$cssInline
protected
array<string, array<string|int, mixed>>
$cssInline
= []
$cssLibs
protected
array<string, array<string|int, mixed>>
$cssLibs
= []
$docType
protected
DocType
$docType
= \TYPO3\CMS\Core\Type\DocType::html5
$endingSlash
Is empty string for HTML and ' /' for XHTML rendering
protected
string
$endingSlash
= ''
$favIcon
protected
string
$favIcon
= ''
$footerData
protected
array<string|int, mixed>
$footerData
= []
$headerData
protected
array<string|int, mixed>
$headerData
= []
$headTag
protected
string
$headTag
= '<head>'
$htmlTag
protected
string
$htmlTag
= '<html>'
$iconMimeType
protected
string
$iconMimeType
= ''
$inlineComments
protected
array<string|int, mixed>
$inlineComments
= []
$inlineLanguageLabelFiles
protected
array<string|int, mixed>
$inlineLanguageLabelFiles
= []
$inlineLanguageLabels
protected
array<string|int, mixed>
$inlineLanguageLabels
= []
$inlineSettings
protected
array<string|int, mixed>
$inlineSettings
= []
$javaScriptRenderer
protected
JavaScriptRenderer
$javaScriptRenderer
$jsFiles
protected
array<string, array<string|int, mixed>>
$jsFiles
= []
$jsFooterFiles
protected
array<string|int, mixed>
$jsFooterFiles
= []
$jsFooterInline
protected
array<string|int, mixed>
$jsFooterInline
= []
$jsFooterLibs
protected
array<string|int, mixed>
$jsFooterLibs
= []
$jsInline
protected
array<string, array<string|int, mixed>>
$jsInline
= []
$jsLibs
protected
array<string|int, mixed>
$jsLibs
= []
$languageServiceFactory read-only
protected
LanguageServiceFactory
$languageServiceFactory
$locale
The locale, used for the <html> tag (depending on the DocType) and possible translation files.
protected
Locale
$locale
$metaTagRegistry read-only
protected
MetaTagManagerRegistry
$metaTagRegistry
$moveJsFromHeaderToFooter
protected
bool
$moveJsFromHeaderToFooter
= false
$nonce
protected
ConsumableNonce|null
$nonce
= null
$relativeCssPathFixer read-only
protected
RelativeCssPathFixer
$relativeCssPathFixer
$resourceCompressor read-only
protected
ResourceCompressor
$resourceCompressor
$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
= ''
$templateService read-only
protected
MarkerBasedTemplateService
$templateService
$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, ResourceCompressor $resourceCompressor, RelativeCssPathFixer $relativeCssPathFixer, LanguageServiceFactory $languageServiceFactory, ResponseFactoryInterface $responseFactory, StreamFactoryInterface $streamFactory) : mixed
Parameters
- $assetsCache : FrontendInterface
- $templateService : MarkerBasedTemplateService
- $metaTagRegistry : MetaTagManagerRegistry
- $assetRenderer : AssetRenderer
- $resourceCompressor : ResourceCompressor
- $relativeCssPathFixer : RelativeCssPathFixer
- $languageServiceFactory : LanguageServiceFactory
- $responseFactory : ResponseFactoryInterface
- $streamFactory : StreamFactoryInterface
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<string|int, mixed> $array) : mixed
Parameters
- $array : array<string|int, mixed>
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<string|int, mixed> $array) : mixed
Parameters
- $namespace : string
- $array : array<string|int, mixed>
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
stringgetBodyContent()
Gets content for body
public
getBodyContent() : string
Return values
stringgetCompressCss()
Gets compress of css
public
getCompressCss() : bool
Return values
boolgetCompressJavascript()
Gets compress of javascript
public
getCompressJavascript() : bool
Return values
boolgetConcatenateCss()
Gets concatenate of css files
public
getConcatenateCss() : bool
Return values
boolgetConcatenateJavascript()
Gets concatenate of js files
public
getConcatenateJavascript() : bool
Return values
boolgetDocType()
public
getDocType() : DocType
Return values
DocTypegetFavIcon()
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<string|int, mixed>
Return values
array<string|int, mixed>getInlineLanguageLabels()
Gets the inline language labels.
public
getInlineLanguageLabels() : array<string|int, mixed>
Return values
array<string|int, mixed> —The inline language labels
getJavaScriptRenderer()
public
getJavaScriptRenderer() : JavaScriptRenderer
Return values
JavaScriptRenderergetLanguage()
Gets the language
public
getLanguage() : string
Return values
stringgetMetaTag()
Returns the requested meta tag
public
getMetaTag(string $type, string $name) : array<string|int, mixed>
Parameters
- $type : string
- $name : string
Return values
array<string|int, mixed>getMoveJsFromHeaderToFooter()
Gets MoveJsFromHeaderToFooter
public
getMoveJsFromHeaderToFooter() : bool
Return values
boolgetState()
public
getState() : array<string|int, mixed>
Return values
array<string|int, mixed>getTemplateFile()
Gets template file
public
getTemplateFile() : string
Return values
stringgetTitle()
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
stringrenderPageWithUncachedObjects()
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
ResponseInterfacesetApplyNonceHint()
public
setApplyNonceHint(bool $applyNonceHint) : void
Parameters
- $applyNonceHint : bool
setBodyContent()
Sets Content for Body
public
setBodyContent(string $content) : mixed
Parameters
- $content : string
setDocType()
public
setDocType(DocType $docType) : void
Parameters
- $docType : DocType
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
setLanguage()
Sets language
public
setLanguage(Locale $locale) : void
Parameters
- $locale : Locale
setMetaTag()
Sets a given meta tag
public
setMetaTag(string $type, string $name, string $content[, array<string|int, mixed> $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<string|int, mixed> = []
-
Subproperties of the meta tag (like e.g. og:image:width)
- $replace : bool = true
-
Replace earlier set meta tag
Tags
setNonce()
public
setNonce(ConsumableNonce|null $nonce) : void
Parameters
- $nonce : ConsumableNonce|null
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<string|int, mixed> $state) : void
Parameters
- $state : array<string|int, mixed>
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<string|int, mixed> $properties) : string
Parameters
- $file : string
-
the filename to process
- $properties : array<string|int, mixed>
Return values
stringdoCompress()
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
Return values
stringgetPreparedMarkerArray()
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<string|int, mixed>
Parameters
- $jsLibs : string
- $jsFiles : string
- $jsFooterFiles : string
- $cssLibs : string
- $cssFiles : string
- $jsInline : string
- $cssInline : string
- $jsFooterInline : string
- $jsFooterLibs : string
- $metaTags : string
Return values
array<string|int, mixed> —Marker array
getPreparedMarkerArrayForPageWithUncachedObjects()
Fills the marker array with the given strings and trims each value
protected
getPreparedMarkerArrayForPageWithUncachedObjects(string $substituteHash) : array<string|int, mixed>
Parameters
- $substituteHash : string
-
The hash that is used for the placeholder markers
Return values
array<string|int, mixed> —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
stringgetTemplate()
Reads the template file and returns the requested part as string
protected
getTemplate() : string
Return values
stringincludeLanguageFileForInline()
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<string|int, mixed>
Return values
array<string|int, mixed>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
processJsFile()
Processes a Javascript file dependent on the current context
protected
processJsFile(string $filename) : string
Adds the version number for Frontend, compresses the file for Backend
Parameters
- $filename : string
-
Filename
Return values
string —New filename
readLLfile()
Reads a locallang file.
protected
readLLfile(string $fileRef) : array<string|int, mixed>
Parameters
- $fileRef : string
-
Reference to a relative filename to include.
Return values
array<string|int, mixed> —Returns the $LOCAL_LANG array found in the file. If no array found, returns empty array.
renderAdditionalJavaScriptLibraries()
Render JavaScript libraries
protected
renderAdditionalJavaScriptLibraries() : array<string|int, mixed>|array<string|int, string>
Return values
array<string|int, mixed>|array<string|int, string> —jsLibs and jsFooterLibs strings
renderCssFiles()
Render CSS files
protected
renderCssFiles() : string
Return values
stringrenderCssInline()
Render inline CSS
protected
renderCssInline() : string
Return values
stringrenderCssLibraries()
Render CSS library files
protected
renderCssLibraries() : string
Return values
stringrenderInlineJavaScript()
Render inline JavaScript (must not apply `nonce="..."` if defined).
protected
renderInlineJavaScript() : array<string|int, mixed>|array<string|int, string>
Return values
array<string|int, mixed>|array<string|int, string> —jsInline and jsFooterInline string
renderJavaScriptAndCss()
Renders all JavaScript and CSS
protected
renderJavaScriptAndCss() : array<string|int, mixed>|array<string|int, string>
Return values
array<string|int, mixed>|array<string|int, string>renderJavaScriptFiles()
Render JavaScript files
protected
renderJavaScriptFiles() : array<string|int, mixed>|array<string|int, string>
Return values
array<string|int, mixed>|array<string|int, 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<string|int, mixed>
Return values
array<string|int, mixed>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<string|int, mixed> $attributes = [] ]) : string
Parameters
- $content : string
- $attributes : array<string|int, mixed> = []
Return values
stringwrapInlineStyle()
protected
wrapInlineStyle(string $content[, array<string|int, mixed> $attributes = [] ]) : string
Parameters
- $content : string
- $attributes : array<string|int, mixed> = []