TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
PageRenderer Class Reference
Inheritance diagram for PageRenderer:
SingletonInterface

Public Member Functions

 __construct ($templateFile= '')
 
 setTitle ($title)
 
 setRenderXhtml ($enable)
 
 setXmlPrologAndDocType ($xmlPrologAndDocType)
 
 setCharSet ($charSet)
 
 setLanguage ($lang)
 
 setMetaCharsetTag ($metaCharsetTag)
 
 setHtmlTag ($htmlTag)
 
 setHeadTag ($headTag)
 
 setFavIcon ($favIcon)
 
 setIconMimeType ($iconMimeType)
 
 setBaseUrl ($baseUrl)
 
 setTemplateFile ($file)
 
 setBodyContent ($content)
 
 setRequireJsPath ($path)
 
 setExtJsPath ($path)
 
 enableMoveJsFromHeaderToFooter ()
 
 disableMoveJsFromHeaderToFooter ()
 
 enableCompressJavascript ()
 
 disableCompressJavascript ()
 
 enableCompressCss ()
 
 disableCompressCss ()
 
 enableConcatenateFiles ()
 
 disableConcatenateFiles ()
 
 enableConcatenateJavascript ()
 
 disableConcatenateJavascript ()
 
 enableConcatenateCss ()
 
 disableConcatenateCss ()
 
 enableRemoveLineBreaksFromTemplate ()
 
 disableRemoveLineBreaksFromTemplate ()
 
 enableDebugMode ()
 
 getTitle ()
 
 getCharSet ()
 
 getLanguage ()
 
 getRenderXhtml ()
 
 getHtmlTag ()
 
 getMetaCharsetTag ()
 
 getHeadTag ()
 
 getFavIcon ()
 
 getIconMimeType ()
 
 getBaseUrl ()
 
 getTemplateFile ()
 
 getMoveJsFromHeaderToFooter ()
 
 getCompressJavascript ()
 
 getCompressCss ()
 
 getConcatenateFiles ()
 
 getConcatenateJavascript ()
 
 getConcatenateCss ()
 
 getRemoveLineBreaksFromTemplate ()
 
 getBodyContent ()
 
 getExtJsPath ()
 
 getInlineLanguageLabels ()
 
 getInlineLanguageLabelFiles ()
 
 addMetaTag ($meta)
 
 addInlineComment ($comment)
 
 addHeaderData ($data)
 
 addFooterData ($data)
 
 addJsLibrary ($name, $file, $type= 'text/javascript', $compress=false, $forceOnTop=false, $allWrap= '', $excludeFromConcatenation=false, $splitChar= '|', $async=false, $integrity= '')
 
 addJsFooterLibrary ($name, $file, $type= 'text/javascript', $compress=false, $forceOnTop=false, $allWrap= '', $excludeFromConcatenation=false, $splitChar= '|', $async=false, $integrity= '')
 
 addJsFile ($file, $type= 'text/javascript', $compress=true, $forceOnTop=false, $allWrap= '', $excludeFromConcatenation=false, $splitChar= '|', $async=false, $integrity= '')
 
 addJsFooterFile ($file, $type= 'text/javascript', $compress=true, $forceOnTop=false, $allWrap= '', $excludeFromConcatenation=false, $splitChar= '|', $async=false, $integrity= '')
 
 addJsInlineCode ($name, $block, $compress=true, $forceOnTop=false)
 
 addJsFooterInlineCode ($name, $block, $compress=true, $forceOnTop=false)
 
 addExtOnReadyCode ($block, $forceOnTop=false)
 
 addCssFile ($file, $rel= 'stylesheet', $media= 'all', $title= '', $compress=true, $forceOnTop=false, $allWrap= '', $excludeFromConcatenation=false, $splitChar= '|')
 
 addCssLibrary ($file, $rel= 'stylesheet', $media= 'all', $title= '', $compress=true, $forceOnTop=false, $allWrap= '', $excludeFromConcatenation=false, $splitChar= '|')
 
 addCssInlineBlock ($name, $block, $compress=false, $forceOnTop=false)
 
 loadJquery ($version=null, $source=null, $namespace=self::JQUERY_NAMESPACE_DEFAULT)
 
 addRequireJsConfiguration (array $configuration)
 
 loadRequireJsModule ($mainModuleName, $callBackFunction=null)
 
 loadExtJS ($css=true, $theme=true)
 
 enableExtJsDebug ()
 
 addInlineLanguageLabel ($key, $value)
 
 addInlineLanguageLabelArray (array $array, $parseWithLanguageService=false)
 
 addInlineLanguageLabelFile ($fileRef, $selectionPrefix= '', $stripFromSelectionName= '', $errorMode=0)
 
 addInlineSetting ($namespace, $key, $value)
 
 addInlineSettingArray ($namespace, array $array)
 
 addBodyContent ($content)
 
 render ($part=self::PART_COMPLETE)
 
 renderPageWithUncachedObjects ($substituteHash)
 
 renderJavaScriptAndCssForProcessingOfUncachedContentObjects ($cachedPageContent, $substituteHash)
 

Public Attributes

const PART_COMPLETE = 0
 
const PART_HEADER = 1
 
const PART_FOOTER = 2
 
const JQUERY_VERSION_LATEST = '3.1.1'
 
const JQUERY_NAMESPACE_NONE = 'none'
 
const JQUERY_NAMESPACE_DEFAULT = 'jQuery'
 
const JQUERY_NAMESPACE_DEFAULT_NOCONFLICT = 'defaultNoConflict'
 

Protected Member Functions

 reset ()
 
 computeRequireJsConfig ($isDevelopment, array $loadedExtensions)
 
 prepareRendering ()
 
 renderJavaScriptAndCss ()
 
 getPreparedMarkerArray ($jsLibs, $jsFiles, $jsFooterFiles, $cssLibs, $cssFiles, $jsInline, $cssInline, $jsFooterInline, $jsFooterLibs, $metaTags)
 
 getPreparedMarkerArrayForPageWithUncachedObjects ($substituteHash)
 
 getTemplateForPart ($part)
 
 renderMainJavaScriptLibraries ()
 
 loadJavaScriptLanguageStrings ()
 
 renderJqueryScriptTag ($version, $source, $namespace)
 
 renderCssLibraries ()
 
 renderCssFiles ()
 
 renderCssInline ()
 
 renderAdditionalJavaScriptLibraries ()
 
 renderJavaScriptFiles ()
 
 renderInlineJavaScript ()
 
 includeLanguageFileForInline ($fileRef, $selectionPrefix= '', $stripFromSelectionName= '', $errorMode=0)
 
 doConcatenate ()
 
 doConcatenateJavaScript ()
 
 doConcatenateCss ()
 
 doCompress ()
 
 doCompressCss ()
 
 doCompressJavaScript ()
 
 getCompressor ()
 
 processJsFile ($filename)
 
 getStreamlinedFileName ($file, $prepareForOutput=true)
 
 getTypoScriptFrontendController ()
 
 getLanguageService ()
 
 executePreRenderHook ()
 
 executeRenderPostTransformHook ()
 
 executePostRenderHook (&$jsLibs, &$jsFiles, &$jsFooterFiles, &$cssLibs, &$cssFiles, &$jsInline, &$cssInline, &$jsFooterInline, &$jsFooterLibs)
 

Protected Attributes

 $compressJavascript = false
 
 $compressCss = false
 
 $removeLineBreaksFromTemplate = false
 
 $concatenateFiles = false
 
 $concatenateJavascript = false
 
 $concatenateCss = false
 
 $moveJsFromHeaderToFooter = false
 
 $csConvObj
 
 $locales
 
 $lang
 
 $languageDependencies = []
 
 $compressor
 
 $jsFiles = []
 
 $jsFooterFiles = []
 
 $jsLibs = []
 
 $jsFooterLibs = []
 
 $cssFiles = []
 
 $cssLibs = []
 
 $title
 
 $charSet
 
 $favIcon
 
 $baseUrl
 
 $renderXhtml = true
 
 $xmlPrologAndDocType = ''
 
 $metaTags = []
 
 $inlineComments = []
 
 $headerData = []
 
 $footerData = []
 
 $titleTag = '<title>|</title>'
 
 $metaCharsetTag = '<meta http-equiv="Content-Type" content="text/html; charset=|" />'
 
 $htmlTag = '<html>'
 
 $headTag = '<head>'
 
 $baseUrlTag = '<base href="|" />'
 
 $iconMimeType = ''
 
 $shortcutTag = '<link rel="shortcut icon" href="%1$s"%2$s />'
 
 $jsInline = []
 
 $jsFooterInline = []
 
 $extOnReadyCode = []
 
 $cssInline = []
 
 $bodyContent
 
 $templateFile
 
 $jsLibraryNames = ['extjs']
 
 $requireJsPath = 'EXT:core/Resources/Public/JavaScript/Contrib/'
 
 $extJsPath = 'EXT:core/Resources/Public/JavaScript/Contrib/extjs/'
 
 $jQueryPath = 'EXT:core/Resources/Public/JavaScript/Contrib/jquery/'
 
 $jQueryVersions = []
 
 $availableLocalJqueryVersions
 
 $jQueryCdnUrls
 
 $addRequireJs = false
 
 $requireJsConfig = []
 
 $addExtJS = false
 
 $extDirectCodeAdded = false
 
 $enableExtJsDebug = false
 
 $enableJqueryDebug = false
 
 $extJStheme = true
 
 $extJScss = true
 
 $inlineLanguageLabels = []
 
 $inlineLanguageLabelFiles = []
 
 $inlineSettings = []
 
 $inlineJavascriptWrap = []
 
 $inlineCssWrap = []
 
 $compressError = ''
 
 $endingSlash = ''
 

Detailed Description

TYPO3 pageRender class (new in TYPO3 4.3.0) This class render the HTML of a webpage, usable for BE and FE

Definition at line 33 of file PageRenderer.php.

Constructor & Destructor Documentation

__construct (   $templateFile = '')
Parameters
string$templateFileDeclare the used template file. Omit this parameter will use default template

Definition at line 414 of file PageRenderer.php.

References PageRenderer\$templateFile, GeneralUtility\makeInstance(), and PageRenderer\reset().

Member Function Documentation

addBodyContent (   $content)

Adds content to body content

Parameters
string$content
Returns
void

Definition at line 1809 of file PageRenderer.php.

addCssFile (   $file,
  $rel = 'stylesheet',
  $media = 'all',
  $title = '',
  $compress = true,
  $forceOnTop = false,
  $allWrap = '',
  $excludeFromConcatenation = false,
  $splitChar = '|' 
)

Adds CSS file

Parameters
string$file
string$rel
string$media
string$title
bool$compress
bool$forceOnTop
string$allWrap
bool$excludeFromConcatenation
string$splitCharThe char used to split the allWrap value, default is "|"
Returns
void

Definition at line 1419 of file PageRenderer.php.

References PageRenderer\$title.

addCssInlineBlock (   $name,
  $block,
  $compress = false,
  $forceOnTop = false 
)

Adds CSS inline code

Parameters
string$name
string$block
bool$compress
bool$forceOnTop
Returns
void

Definition at line 1476 of file PageRenderer.php.

addCssLibrary (   $file,
  $rel = 'stylesheet',
  $media = 'all',
  $title = '',
  $compress = true,
  $forceOnTop = false,
  $allWrap = '',
  $excludeFromConcatenation = false,
  $splitChar = '|' 
)

Adds CSS file

Parameters
string$file
string$rel
string$media
string$title
bool$compress
bool$forceOnTop
string$allWrap
bool$excludeFromConcatenation
string$splitCharThe char used to split the allWrap value, default is "|"
Returns
void

Definition at line 1450 of file PageRenderer.php.

References PageRenderer\$title.

Referenced by PageRenderer\renderMainJavaScriptLibraries().

addExtOnReadyCode (   $block,
  $forceOnTop = false 
)

Adds Ext.onready code, which will be wrapped in Ext.onReady(function() {...});

Parameters
string$blockJavascript code
bool$forceOnTopPosition of the javascript code (TRUE for putting it on top, default is FALSE = bottom)
Returns
void

Definition at line 1272 of file PageRenderer.php.

addFooterData (   $data)

Adds footer data

Parameters
string$dataFree header data for HTML header
Returns
void

Definition at line 1074 of file PageRenderer.php.

addHeaderData (   $data)

Adds header data

Parameters
string$dataFree header data for HTML header
Returns
void

Definition at line 1061 of file PageRenderer.php.

addInlineComment (   $comment)

Adds inline HTML comment

Parameters
string$comment
Returns
void

Definition at line 1048 of file PageRenderer.php.

addInlineLanguageLabel (   $key,
  $value 
)

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

Parameters
string$key
string$value
Returns
void

Definition at line 1695 of file PageRenderer.php.

addInlineLanguageLabelArray ( array  $array,
  $parseWithLanguageService = false 
)

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. Need extJs loaded

Parameters
array$array
bool$parseWithLanguageService
Returns
void

Definition at line 1710 of file PageRenderer.php.

References PageRenderer\getLanguageService(), and PageRenderer\getTypoScriptFrontendController().

addInlineLanguageLabelFile (   $fileRef,
  $selectionPrefix = '',
  $stripFromSelectionName = '',
  $errorMode = 0 
)

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

Parameters
string$fileRefInput is a file-reference (see GeneralUtility::getFileAbsFileName). That file is expected to be a 'locallang.xlf' file containing a valid XML TYPO3 language structure.
string$selectionPrefixPrefix to select the correct labels (default: '')
string$stripFromSelectionNameString to be removed from the label names in the output. (default: '')
int$errorModeError mode (when file could not be found): 0 - syslog entry, 1 - do nothing, 2 - throw an exception
Returns
void

Definition at line 1734 of file PageRenderer.php.

addInlineSetting (   $namespace,
  $key,
  $value 
)

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

Parameters
string$namespace
string$key
string$value
Returns
void

Definition at line 1757 of file PageRenderer.php.

References PageRenderer\$inlineSettings.

addInlineSettingArray (   $namespace,
array  $array 
)

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. Need extJs loaded

Parameters
string$namespace
array$array
Returns
void

Definition at line 1785 of file PageRenderer.php.

References PageRenderer\$inlineSettings.

Referenced by PageRenderer\computeRequireJsConfig().

addJsFile (   $file,
  $type = 'text/javascript',
  $compress = true,
  $forceOnTop = false,
  $allWrap = '',
  $excludeFromConcatenation = false,
  $splitChar = '|',
  $async = false,
  $integrity = '' 
)

Adds JS file

Parameters
string$fileFile name
string$typeContent Type
bool$compress
bool$forceOnTop
string$allWrap
bool$excludeFromConcatenation
string$splitCharThe char used to split the allWrap value, default is "|"
bool$asyncFlag if property 'async="async"' should be added to JavaScript tags
string$integritySubresource Integrity (SRI)
Returns
void

Definition at line 1167 of file PageRenderer.php.

addJsFooterFile (   $file,
  $type = 'text/javascript',
  $compress = true,
  $forceOnTop = false,
  $allWrap = '',
  $excludeFromConcatenation = false,
  $splitChar = '|',
  $async = false,
  $integrity = '' 
)

Adds JS file to footer

Parameters
string$fileFile name
string$typeContent Type
bool$compress
bool$forceOnTop
string$allWrap
bool$excludeFromConcatenation
string$splitCharThe char used to split the allWrap value, default is "|"
bool$asyncFlag if property 'async="async"' should be added to JavaScript tags
string$integritySubresource Integrity (SRI)
Returns
void

Definition at line 1202 of file PageRenderer.php.

addJsFooterInlineCode (   $name,
  $block,
  $compress = true,
  $forceOnTop = false 
)

Adds JS inline code to footer

Parameters
string$name
string$block
bool$compress
bool$forceOnTop
Returns
void

Definition at line 1253 of file PageRenderer.php.

addJsFooterLibrary (   $name,
  $file,
  $type = 'text/javascript',
  $compress = false,
  $forceOnTop = false,
  $allWrap = '',
  $excludeFromConcatenation = false,
  $splitChar = '|',
  $async = false,
  $integrity = '' 
)

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

Parameters
string$nameArbitrary identifier
string$fileFile name
string$typeContent Type
bool$compressFlag if library should be compressed
bool$forceOnTopFlag if added library should be inserted at begin of this block
string$allWrap
bool$excludeFromConcatenation
string$splitCharThe char used to split the allWrap value, default is "|"
bool$asyncFlag if property 'async="async"' should be added to JavaScript tags
string$integritySubresource Integrity (SRI)
Returns
void

Definition at line 1132 of file PageRenderer.php.

addJsInlineCode (   $name,
  $block,
  $compress = true,
  $forceOnTop = false 
)

Adds JS inline code

Parameters
string$name
string$block
bool$compress
bool$forceOnTop
Returns
void

Definition at line 1232 of file PageRenderer.php.

Referenced by PageRenderer\loadRequireJsModule().

addJsLibrary (   $name,
  $file,
  $type = 'text/javascript',
  $compress = false,
  $forceOnTop = false,
  $allWrap = '',
  $excludeFromConcatenation = false,
  $splitChar = '|',
  $async = false,
  $integrity = '' 
)

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

Parameters
string$nameArbitrary identifier
string$fileFile name
string$typeContent Type
bool$compressFlag if library should be compressed
bool$forceOnTopFlag if added library should be inserted at begin of this block
string$allWrap
bool$excludeFromConcatenation
string$splitCharThe char used to split the allWrap value, default is "|"
bool$asyncFlag if property 'async="async"' should be added to JavaScript tags
string$integritySubresource Integrity (SRI)
Returns
void

Definition at line 1096 of file PageRenderer.php.

addMetaTag (   $meta)

Adds meta data

Parameters
string$metaMeta data (complete metatag)
Returns
void

Definition at line 1035 of file PageRenderer.php.

addRequireJsConfiguration ( array  $configuration)

Add additional configuration to require js.

Configuration will be merged recursive with overrule.

To add another path mapping deliver the following configuration: 'paths' => array( 'EXTERN/mybootstrapjs' => 'sysext/.../twbs/bootstrap.min', ),

Parameters
array$configurationThe configuration that will be merged with existing one.
Returns
void

Definition at line 1620 of file PageRenderer.php.

References ArrayUtility\mergeRecursiveWithOverrule().

computeRequireJsConfig (   $isDevelopment,
array  $loadedExtensions 
)
protected

Computes the RequireJS configuration, mainly consisting of the paths to the core and all extension JavaScript resource folders plus some additional generic configuration.

Parameters
bool$isDevelopment
array$loadedExtensions
Returns
array The RequireJS configuration

Definition at line 1555 of file PageRenderer.php.

References $GLOBALS, PageRenderer\$requireJsConfig, PageRenderer\addInlineSettingArray(), ExtensionManagementUtility\extPath(), PathUtility\getAbsoluteWebPath(), GeneralUtility\getFileAbsFileName(), GeneralUtility\hmac(), and GeneralUtility\underscoredToUpperCamelCase().

disableCompressCss ( )

Disables compression of css

Returns
void

Definition at line 696 of file PageRenderer.php.

disableCompressJavascript ( )

Disables compression of javascript

Returns
void

Definition at line 676 of file PageRenderer.php.

disableConcatenateCss ( )

Disables concatenation of css files

Returns
void

Definition at line 756 of file PageRenderer.php.

disableConcatenateFiles ( )

Disables concatenation of js and css files

Returns
void

Definition at line 716 of file PageRenderer.php.

disableConcatenateJavascript ( )

Disables concatenation of js files

Returns
void

Definition at line 736 of file PageRenderer.php.

disableMoveJsFromHeaderToFooter ( )

Disables MoveJsFromHeaderToFooter

Returns
void

Definition at line 656 of file PageRenderer.php.

disableRemoveLineBreaksFromTemplate ( )

Unsets removal of all line breaks in template

Returns
void

Definition at line 776 of file PageRenderer.php.

doCompress ( )
protected

Compresses inline code

Returns
void

Definition at line 2616 of file PageRenderer.php.

References PageRenderer\doCompressCss(), and PageRenderer\doCompressJavaScript().

Referenced by PageRenderer\renderJavaScriptAndCss().

doCompressCss ( )
protected
doConcatenate ( )
protected

Concatenate files into one file registered handler

Returns
void

Definition at line 2551 of file PageRenderer.php.

References PageRenderer\doConcatenateCss(), and PageRenderer\doConcatenateJavaScript().

Referenced by PageRenderer\renderJavaScriptAndCss().

doConcatenateCss ( )
protected
doConcatenateJavaScript ( )
protected
enableCompressCss ( )

Enables compression of css

Returns
void

Definition at line 686 of file PageRenderer.php.

enableCompressJavascript ( )

Enables compression of javascript

Returns
void

Definition at line 666 of file PageRenderer.php.

enableConcatenateCss ( )

Enables concatenation of css files

Returns
void

Definition at line 746 of file PageRenderer.php.

enableConcatenateFiles ( )

Enables concatenation of js and css files

Returns
void

Definition at line 706 of file PageRenderer.php.

enableConcatenateJavascript ( )

Enables concatenation of js files

Returns
void

Definition at line 726 of file PageRenderer.php.

enableDebugMode ( )

Enables Debug Mode This is a shortcut to switch off all compress/concatenate features to enable easier debug

Returns
void

Definition at line 787 of file PageRenderer.php.

References PageRenderer\enableExtJsDebug().

enableExtJsDebug ( )

Call this function to load debug version of ExtJS. Use this for development only

Returns
void

Definition at line 1681 of file PageRenderer.php.

Referenced by PageRenderer\enableDebugMode(), and PageRenderer\renderMainJavaScriptLibraries().

enableMoveJsFromHeaderToFooter ( )

Enables MoveJsFromHeaderToFooter

Returns
void

Definition at line 646 of file PageRenderer.php.

enableRemoveLineBreaksFromTemplate ( )

Sets removal of all line breaks in template

Returns
void

Definition at line 766 of file PageRenderer.php.

executePostRenderHook ( $jsLibs,
$jsFiles,
$jsFooterFiles,
$cssLibs,
$cssFiles,
$jsInline,
$cssInline,
$jsFooterInline,
$jsFooterLibs 
)
protected
getBaseUrl ( )

Gets HTML base URL

Returns
string $url

Definition at line 898 of file PageRenderer.php.

References PageRenderer\$baseUrl.

getBodyContent ( )

Gets content for body

Returns
string

Definition at line 988 of file PageRenderer.php.

References PageRenderer\$bodyContent.

getCharSet ( )

Gets the charSet

Returns
string $charSet

Definition at line 818 of file PageRenderer.php.

References PageRenderer\$charSet.

Referenced by PageRenderer\loadJavaScriptLanguageStrings().

getCompressCss ( )

Gets compress of css

Returns
bool

Definition at line 938 of file PageRenderer.php.

References PageRenderer\$compressCss.

getCompressJavascript ( )

Gets compress of javascript

Returns
bool

Definition at line 928 of file PageRenderer.php.

References PageRenderer\$compressJavascript.

getConcatenateCss ( )

Gets concatenate of css files

Returns
bool

Definition at line 968 of file PageRenderer.php.

References PageRenderer\$concatenateCss.

getConcatenateFiles ( )

Gets concatenate of js and css files

Returns
bool

Definition at line 948 of file PageRenderer.php.

References PageRenderer\$concatenateFiles.

getConcatenateJavascript ( )

Gets concatenate of js files

Returns
bool

Definition at line 958 of file PageRenderer.php.

References PageRenderer\$concatenateJavascript.

getExtJsPath ( )

Gets Path for ExtJs library (relative to typo3 directory)

Returns
string

Definition at line 998 of file PageRenderer.php.

References PageRenderer\$extJsPath.

getFavIcon ( )

Gets favicon

Returns
string $favIcon

Definition at line 878 of file PageRenderer.php.

References PageRenderer\$favIcon.

getHeadTag ( )

Gets head tag

Returns
string $tag Head tag

Definition at line 868 of file PageRenderer.php.

References PageRenderer\$headTag.

getHtmlTag ( )

Gets html tag

Returns
string $htmlTag Html tag

Definition at line 848 of file PageRenderer.php.

References PageRenderer\$htmlTag.

getIconMimeType ( )

Gets icon mime type

Returns
string $iconMimeType

Definition at line 888 of file PageRenderer.php.

References PageRenderer\$iconMimeType.

getInlineLanguageLabelFiles ( )

Gets the inline language files

Returns
array

Definition at line 1018 of file PageRenderer.php.

References PageRenderer\$inlineLanguageLabelFiles.

getInlineLanguageLabels ( )

Gets the inline language labels.

Returns
array The inline language labels

Definition at line 1008 of file PageRenderer.php.

References PageRenderer\$inlineLanguageLabels.

getLanguage ( )

Gets the language

Returns
string $lang

Definition at line 828 of file PageRenderer.php.

References PageRenderer\$lang.

getLanguageService ( )
protected

Returns global language service instance

Returns

Definition at line 2763 of file PageRenderer.php.

References $GLOBALS.

Referenced by PageRenderer\addInlineLanguageLabelArray().

getMetaCharsetTag ( )

Get meta charset

Returns
string

Definition at line 858 of file PageRenderer.php.

References PageRenderer\$metaCharsetTag.

getMoveJsFromHeaderToFooter ( )

Gets MoveJsFromHeaderToFooter

Returns
bool

Definition at line 918 of file PageRenderer.php.

References PageRenderer\$moveJsFromHeaderToFooter.

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

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

Parameters
$jsLibsstring
$jsFilesstring
$jsFooterFilesstring
$cssLibsstring
$cssFilesstring
$jsInlinestring
$cssInlinestring
$jsFooterInlinestring
$jsFooterLibsstring
$metaTagsstring
Returns
array Marker array

Definition at line 1963 of file PageRenderer.php.

References PageRenderer\$bodyContent, PageRenderer\$cssFiles, PageRenderer\$cssInline, PageRenderer\$cssLibs, PageRenderer\$headTag, PageRenderer\$htmlTag, PageRenderer\$jsFiles, PageRenderer\$jsFooterFiles, PageRenderer\$jsFooterInline, PageRenderer\$jsFooterLibs, PageRenderer\$jsInline, PageRenderer\$jsLibs, PageRenderer\$metaTags, and PageRenderer\$xmlPrologAndDocType.

Referenced by PageRenderer\render().

getPreparedMarkerArrayForPageWithUncachedObjects (   $substituteHash)
protected

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

Parameters
string$substituteHashThe hash that is used for the placehoder markers
Returns
array Marker array

Definition at line 1998 of file PageRenderer.php.

References PageRenderer\$bodyContent, PageRenderer\$headTag, PageRenderer\$htmlTag, and PageRenderer\$xmlPrologAndDocType.

Referenced by PageRenderer\renderPageWithUncachedObjects().

getRemoveLineBreaksFromTemplate ( )

Gets remove of empty lines from template

Returns
bool

Definition at line 978 of file PageRenderer.php.

References PageRenderer\$removeLineBreaksFromTemplate.

getRenderXhtml ( )

Returns rendering mode XHTML or HTML

Returns
bool TRUE if XHTML, FALSE if HTML

Definition at line 838 of file PageRenderer.php.

References PageRenderer\$renderXhtml.

Referenced by PageRenderer\prepareRendering().

getStreamlinedFileName (   $file,
  $prepareForOutput = true 
)
protected

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.

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
string$filethe filename to process
bool$prepareForOutputwhether the file should be prepared as version numbered file and prefixed as absolute webpath
Returns
string

Definition at line 2731 of file PageRenderer.php.

References GeneralUtility\createVersionNumberedFilename(), PathUtility\getAbsoluteWebPath(), GeneralUtility\getFileAbsFileName(), PathUtility\getRelativePathTo(), and GeneralUtility\resolveBackPath().

Referenced by PageRenderer\processJsFile(), PageRenderer\renderAdditionalJavaScriptLibraries(), PageRenderer\renderCssFiles(), PageRenderer\renderCssLibraries(), and PageRenderer\renderJavaScriptFiles().

getTemplateFile ( )

Gets template file

Returns
string

Definition at line 908 of file PageRenderer.php.

References PageRenderer\$templateFile.

getTemplateForPart (   $part)
protected

Reads the template file and returns the requested part as string

Parameters
int$part
Returns
string

Definition at line 2033 of file PageRenderer.php.

References PageRenderer\$templateFile, and GeneralUtility\getFileAbsFileName().

Referenced by PageRenderer\render(), and PageRenderer\renderPageWithUncachedObjects().

getTitle ( )

Gets the title

Returns
string $title Title of webpage

Definition at line 808 of file PageRenderer.php.

References PageRenderer\$title.

getTypoScriptFrontendController ( )
protected

Returns global frontend controller

Returns
TypoScriptFrontendController

Definition at line 2753 of file PageRenderer.php.

References $GLOBALS.

Referenced by PageRenderer\addInlineLanguageLabelArray().

includeLanguageFileForInline (   $fileRef,
  $selectionPrefix = '',
  $stripFromSelectionName = '',
  $errorMode = 0 
)
protected

Include language file for inline usage

Parameters
string$fileRef
string$selectionPrefix
string$stripFromSelectionName
int$errorMode
Returns
void
Exceptions
RuntimeException

Definition at line 2473 of file PageRenderer.php.

Referenced by PageRenderer\loadJavaScriptLanguageStrings().

loadExtJS (   $css = true,
  $theme = true 
)

call this function if you need the extJS library

Parameters
bool$cssFlag, if set the ext-css will be loaded
bool$themeFlag, if set the ext-theme "grey" will be loaded
Returns
void

Definition at line 1669 of file PageRenderer.php.

loadJavaScriptLanguageStrings ( )
protected

Load the language strings into JavaScript

Definition at line 2162 of file PageRenderer.php.

References PageRenderer\getCharSet(), and PageRenderer\includeLanguageFileForInline().

Referenced by PageRenderer\renderMainJavaScriptLibraries().

loadJquery (   $version = null,
  $source = null,
  $namespace = self::JQUERY_NAMESPACE_DEFAULT 
)

Call this function if you need to include the jQuery library

Parameters
null | string$versionThe jQuery version that should be included, either "latest" or any available version
null | string$sourceThe location of the jQuery source, can be "local", "google", "msn", "jquery" or just an URL to your jQuery lib
string$namespaceThe namespace in which the jQuery object of the specific version should be stored.
Returns
void
Exceptions
UnexpectedValueException

Definition at line 1496 of file PageRenderer.php.

loadRequireJsModule (   $mainModuleName,
  $callBackFunction = null 
)

includes an AMD-compatible JS file by resolving the ModuleName, and then requires the file via a requireJS request, additionally allowing to execute JavaScript code afterwards

this function only works for AMD-ready JS modules, used like "define('TYPO3/CMS/Backend/FormEngine..." in the JS file

TYPO3/CMS/Backend/FormEngine => "TYPO3": Vendor Name "CMS": Product Name "Backend": Extension Name "FormEngine": FileName in the Resources/Public/JavaScript folder

Parameters
string$mainModuleNameMust be in the form of "TYPO3/CMS/PackageName/ModuleName" e.g. "TYPO3/CMS/Backend/FormEngine"
string$callBackFunctionloaded right after the requireJS loading, must be wrapped in function() {}
Returns
void

Definition at line 1646 of file PageRenderer.php.

References PageRenderer\addJsInlineCode().

Referenced by UsernamePasswordLoginProvider\render(), and PageRenderer\renderMainJavaScriptLibraries().

prepareRendering ( )
protected

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

Returns
void

Definition at line 1899 of file PageRenderer.php.

References PageRenderer\getRenderXhtml().

Referenced by PageRenderer\render(), PageRenderer\renderJavaScriptAndCssForProcessingOfUncachedContentObjects(), and PageRenderer\renderPageWithUncachedObjects().

processJsFile (   $filename)
protected

Processes a Javascript file dependent on the current context

Adds the version number for Frontend, compresses the file for Backend

Parameters
string$filenameFilename
Returns
string New filename

Definition at line 2708 of file PageRenderer.php.

References GeneralUtility\createVersionNumberedFilename(), PathUtility\getAbsoluteWebPath(), PageRenderer\getCompressor(), and PageRenderer\getStreamlinedFileName().

Referenced by PageRenderer\renderJqueryScriptTag(), and PageRenderer\renderMainJavaScriptLibraries().

render (   $part = self::PART_COMPLETE)
renderAdditionalJavaScriptLibraries ( )
protected

Render JavaScipt libraries

Returns
array<string> jsLibs and jsFooterLibs strings

Definition at line 2344 of file PageRenderer.php.

References PageRenderer\$jsFooterLibs, PageRenderer\$jsLibs, and PageRenderer\getStreamlinedFileName().

Referenced by PageRenderer\renderJavaScriptAndCss().

renderCssFiles ( )
protected

Render CSS files

Returns
string

Definition at line 2291 of file PageRenderer.php.

References PageRenderer\$cssFiles, and PageRenderer\getStreamlinedFileName().

Referenced by PageRenderer\renderJavaScriptAndCss().

renderCssInline ( )
protected

Render inline CSS

Returns
string

Definition at line 2322 of file PageRenderer.php.

References PageRenderer\$cssInline.

Referenced by PageRenderer\renderJavaScriptAndCss().

renderCssLibraries ( )
protected

Render CSS library files

Returns
string

Definition at line 2260 of file PageRenderer.php.

References PageRenderer\$cssFiles, and PageRenderer\getStreamlinedFileName().

Referenced by PageRenderer\renderJavaScriptAndCss().

renderInlineJavaScript ( )
protected

Render inline JavaScript

Returns
array<string> jsInline and jsFooterInline string

Definition at line 2428 of file PageRenderer.php.

References PageRenderer\$jsFooterInline, and PageRenderer\$jsInline.

Referenced by PageRenderer\renderJavaScriptAndCss().

renderJavaScriptAndCssForProcessingOfUncachedContentObjects (   $cachedPageContent,
  $substituteHash 
)

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

Parameters
string$cachedPageContent
string$substituteHashThe hash that is used for the placehoder markers private
Returns
string

Definition at line 1866 of file PageRenderer.php.

References PageRenderer\$cssFiles, PageRenderer\$cssInline, PageRenderer\$cssLibs, PageRenderer\$jsFiles, PageRenderer\$jsFooterFiles, PageRenderer\$jsFooterInline, PageRenderer\$jsFooterLibs, PageRenderer\$jsInline, PageRenderer\$jsLibs, PageRenderer\$title, PageRenderer\prepareRendering(), PageRenderer\renderJavaScriptAndCss(), and PageRenderer\reset().

renderJavaScriptFiles ( )
protected

Render JavaScript files

Returns
array<string> jsFiles and jsFooterFiles strings

Definition at line 2386 of file PageRenderer.php.

References PageRenderer\$jsFiles, PageRenderer\$jsFooterFiles, and PageRenderer\getStreamlinedFileName().

Referenced by PageRenderer\renderJavaScriptAndCss().

renderJqueryScriptTag (   $version,
  $source,
  $namespace 
)
protected

Renders the HTML script tag for the given jQuery version.

Parameters
string$versionThe jQuery version that should be included, either "latest" or any available version
string$sourceThe location of the jQuery source, can be "local", "google", "msn" or "jquery
string$namespaceThe namespace in which the jQuery object of the specific version should be stored
Returns
string

Definition at line 2215 of file PageRenderer.php.

References PageRenderer\processJsFile(), and GeneralUtility\wrapJS().

Referenced by PageRenderer\renderMainJavaScriptLibraries().

renderPageWithUncachedObjects (   $substituteHash)

Render the page but not the JavaScript and CSS Files

Parameters
string$substituteHashThe hash that is used for the placehoder markers private
Returns
string Content of rendered section

Definition at line 1848 of file PageRenderer.php.

References PageRenderer\getPreparedMarkerArrayForPageWithUncachedObjects(), PageRenderer\getTemplateForPart(), GeneralUtility\makeInstance(), and PageRenderer\prepareRendering().

reset ( )
protected

Reset all vars to initial values

Returns
void

Definition at line 437 of file PageRenderer.php.

Referenced by PageRenderer\__construct(), PageRenderer\render(), and PageRenderer\renderJavaScriptAndCssForProcessingOfUncachedContentObjects().

setBaseUrl (   $baseUrl)

Sets HTML base URL

Parameters
string$baseUrlHTML base URL
Returns
void

Definition at line 586 of file PageRenderer.php.

References PageRenderer\$baseUrl.

setBodyContent (   $content)

Sets Content for Body

Parameters
string$content
Returns
void

Definition at line 608 of file PageRenderer.php.

setCharSet (   $charSet)

Sets meta charset

Parameters
string$charSetUsed charset
Returns
void

Definition at line 500 of file PageRenderer.php.

References PageRenderer\$charSet.

setExtJsPath (   $path)

Sets Path for ExtJs library (relative to typo3 directory)

Parameters
string$path
Returns
void

Definition at line 630 of file PageRenderer.php.

setFavIcon (   $favIcon)

Sets favicon

Parameters
string$favIcon
Returns
void

Definition at line 564 of file PageRenderer.php.

References PageRenderer\$favIcon.

setHeadTag (   $headTag)

Sets HTML head tag

Parameters
string$headTagHTML head tag
Returns
void

Definition at line 553 of file PageRenderer.php.

References PageRenderer\$headTag.

setHtmlTag (   $htmlTag)

Sets html tag

Parameters
string$htmlTagHtml tag
Returns
void

Definition at line 542 of file PageRenderer.php.

References PageRenderer\$htmlTag.

setIconMimeType (   $iconMimeType)

Sets icon mime type

Parameters
string$iconMimeType
Returns
void

Definition at line 575 of file PageRenderer.php.

References PageRenderer\$iconMimeType.

setLanguage (   $lang)

Sets language

Parameters
string$langUsed language
Returns
void

Definition at line 511 of file PageRenderer.php.

References PageRenderer\$lang.

setMetaCharsetTag (   $metaCharsetTag)

Set the meta charset tag

Parameters
string$metaCharsetTag
Returns
void

Definition at line 531 of file PageRenderer.php.

References PageRenderer\$metaCharsetTag.

setRenderXhtml (   $enable)

Enables/disables rendering of XHTML code

Parameters
bool$enableEnable XHTML
Returns
void

Definition at line 478 of file PageRenderer.php.

setRequireJsPath (   $path)

Sets path to requireJS library (relative to typo3 directory)

Parameters
string$pathPath to requireJS library
Returns
void

Definition at line 619 of file PageRenderer.php.

setTemplateFile (   $file)

Sets template file

Parameters
string$file
Returns
void

Definition at line 597 of file PageRenderer.php.

setTitle (   $title)

Sets the title

Parameters
string$titletitle of webpage
Returns
void

Definition at line 467 of file PageRenderer.php.

References PageRenderer\$title.

setXmlPrologAndDocType (   $xmlPrologAndDocType)

Sets xml prolog and docType

Parameters
string$xmlPrologAndDocTypeComplete tags for xml prolog and docType
Returns
void

Definition at line 489 of file PageRenderer.php.

References PageRenderer\$xmlPrologAndDocType.

Member Data Documentation

$addExtJS = false
protected

Definition at line 345 of file PageRenderer.php.

$addRequireJs = false
protected

Definition at line 334 of file PageRenderer.php.

$availableLocalJqueryVersions
protected
Initial value:
= [
self::JQUERY_VERSION_LATEST
]

Definition at line 314 of file PageRenderer.php.

$baseUrl
protected
$baseUrlTag = '<base href="|" />'
protected

Definition at line 221 of file PageRenderer.php.

Referenced by PageRenderer\executePostRenderHook().

$charSet
protected
$compressCss = false
protected

Definition at line 54 of file PageRenderer.php.

Referenced by PageRenderer\getCompressCss().

$compressError = ''
protected

Definition at line 402 of file PageRenderer.php.

$compressJavascript = false
protected

Definition at line 49 of file PageRenderer.php.

Referenced by PageRenderer\getCompressJavascript().

$compressor
protected

Definition at line 110 of file PageRenderer.php.

Referenced by PageRenderer\getCompressor().

$concatenateCss = false
protected

Definition at line 74 of file PageRenderer.php.

Referenced by PageRenderer\getConcatenateCss().

$concatenateFiles = false
protected

Definition at line 64 of file PageRenderer.php.

Referenced by PageRenderer\getConcatenateFiles().

$concatenateJavascript = false
protected

Definition at line 69 of file PageRenderer.php.

Referenced by PageRenderer\getConcatenateJavascript().

$csConvObj
protected

Definition at line 84 of file PageRenderer.php.

$enableExtJsDebug = false
protected

Definition at line 355 of file PageRenderer.php.

$enableJqueryDebug = false
protected

Definition at line 360 of file PageRenderer.php.

$endingSlash = ''
protected

Definition at line 409 of file PageRenderer.php.

$extDirectCodeAdded = false
protected

Definition at line 350 of file PageRenderer.php.

$extJScss = true
protected

Definition at line 370 of file PageRenderer.php.

$extJsPath = 'EXT:core/Resources/Public/JavaScript/Contrib/extjs/'
protected

Definition at line 280 of file PageRenderer.php.

Referenced by PageRenderer\getExtJsPath().

$extJStheme = true
protected

Definition at line 365 of file PageRenderer.php.

$extOnReadyCode = []
protected

Definition at line 247 of file PageRenderer.php.

$favIcon
protected
$iconMimeType = ''
protected
$inlineComments = []
protected

Definition at line 186 of file PageRenderer.php.

Referenced by PageRenderer\executePostRenderHook().

$inlineCssWrap = []
protected

Definition at line 395 of file PageRenderer.php.

$inlineJavascriptWrap = []
protected

Definition at line 390 of file PageRenderer.php.

$inlineLanguageLabelFiles = []
protected

Definition at line 380 of file PageRenderer.php.

Referenced by PageRenderer\getInlineLanguageLabelFiles().

$inlineLanguageLabels = []
protected

Definition at line 375 of file PageRenderer.php.

Referenced by PageRenderer\getInlineLanguageLabels().

$jQueryCdnUrls
protected
Initial value:
= [
'google' => 'https://ajax.googleapis.com/ajax/libs/jquery/%1$s/jquery%2$s.js'

Definition at line 323 of file PageRenderer.php.

$jQueryPath = 'EXT:core/Resources/Public/JavaScript/Contrib/jquery/'
protected

Definition at line 287 of file PageRenderer.php.

$jQueryVersions = []
protected

Definition at line 307 of file PageRenderer.php.

$jsLibraryNames = ['extjs']
protected

Definition at line 267 of file PageRenderer.php.

$languageDependencies = []
protected

Definition at line 105 of file PageRenderer.php.

$locales
protected

Definition at line 89 of file PageRenderer.php.

$metaCharsetTag = '<meta http-equiv="Content-Type" content="text/html; charset=|" />'
protected
$metaTags = []
protected
$moveJsFromHeaderToFooter = false
protected

Definition at line 79 of file PageRenderer.php.

Referenced by PageRenderer\getMoveJsFromHeaderToFooter().

$removeLineBreaksFromTemplate = false
protected

Definition at line 59 of file PageRenderer.php.

Referenced by PageRenderer\getRemoveLineBreaksFromTemplate().

$renderXhtml = true
protected

Definition at line 170 of file PageRenderer.php.

Referenced by PageRenderer\getRenderXhtml().

$requireJsConfig = []
protected

Definition at line 340 of file PageRenderer.php.

Referenced by PageRenderer\computeRequireJsConfig().

$requireJsPath = 'EXT:core/Resources/Public/JavaScript/Contrib/'
protected

Definition at line 275 of file PageRenderer.php.

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

Definition at line 231 of file PageRenderer.php.

Referenced by PageRenderer\executePostRenderHook().

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

Definition at line 201 of file PageRenderer.php.

Referenced by PageRenderer\executePostRenderHook().

const JQUERY_NAMESPACE_DEFAULT = 'jQuery'

Definition at line 43 of file PageRenderer.php.

Referenced by PageRendererViewHelper\render(), and ContainerViewHelper\render().

const JQUERY_NAMESPACE_DEFAULT_NOCONFLICT = 'defaultNoConflict'

Definition at line 44 of file PageRenderer.php.

const JQUERY_NAMESPACE_NONE = 'none'

Definition at line 42 of file PageRenderer.php.

const PART_COMPLETE = 0

Definition at line 36 of file PageRenderer.php.

Referenced by PageRendererTest\renderMethodCallsResetInAnyCase().