FluidTemplateContentObject

class \TYPO3\CMS\Frontend\ContentObject\FluidTemplateContentObject

Extends
AbstractContentObject

Contains FLUIDTEMPLATE class object

Table of Contents

Properties

$cObj  : ContentObjectRenderer
$contentDataProcessor  : ContentDataProcessor
$pageRenderer  : PageRenderer
$request  : ServerRequestInterface|null
$view  : StandaloneView

Methods

__construct()  : mixed
Default constructor.
getContentObjectRenderer()  : ContentObjectRenderer
Getter for current ContentObjectRenderer
render()  : string
Rendering the cObject, FLUIDTEMPLATE
setContentDataProcessor()  : mixed
setContentObjectRenderer()  : void
setRequest()  : void
applyStandardWrapToFluidPaths()  : array
Applies stdWrap on Fluid path definitions
applyStandardWrapToRenderedContent()  : string
Apply standard wrap to content
assignSettings()  : mixed
Set any TypoScript settings to the view. This is similar to a default MVC action controller in extbase.
getContentObjectVariables()  : array
Compile rendered content objects in variables array ready to assign to the view
getPageRenderer()  : PageRenderer
getPageRepository()  : PageRepository
getTypoScriptFrontendController()  : TypoScriptFrontendController
hasTypoScriptFrontendController()  : bool
initializeStandaloneViewInstance()  : mixed
Creating standalone view instance must not be done in construct() as it can lead to a nasty cache issue since content object instances are not always re-created by the content object rendered for every usage, but can be re-used. Thus, we need a fresh instance of StandaloneView every time render() is called.
renderFluidTemplateAssetsIntoPageRenderer()  : mixed
Attempts to render HeaderAssets and FooterAssets sections from the Fluid template, then adds each (if not empty) to either header or footer, as appropriate, using PageRenderer.
renderFluidView()  : string
Render fluid standalone view
setExtbaseVariables()  : mixed
Set some extbase variables if given
setFormat()  : mixed
Set different format if given in configuration
setLayoutRootPath()  : mixed
Set layout root path if given in configuration
setPartialRootPath()  : mixed
Set partial root path if given in configuration
setTemplate()  : mixed
Set template

Properties

$request

protected ServerRequestInterface|null $request = null

Methods

render()

Rendering the cObject, FLUIDTEMPLATE

public render([array $conf = [] ]) : string

Configuration properties:

  • file string+stdWrap The FLUID template file
  • layoutRootPaths array of filepath+stdWrap Root paths to layouts (fallback)
  • partialRootPaths array of filepath+stdWrap Root paths to partials (fallback)
  • variable array of cObjects, the keys are the variable names in fluid
  • dataProcessing array of data processors which are classes to manipulate $data
  • extbase.pluginName
  • extbase.controllerExtensionName
  • extbase.controllerName
  • extbase.controllerActionName

Example: 10 = FLUIDTEMPLATE 10.templateName = MyTemplate 10.templateRootPaths.10 = EXT:site_configuration/Resources/Private/Templates/ 10.partialRootPaths.10 = EXT:site_configuration/Resources/Private/Partials/ 10.layoutRootPaths.10 = EXT:site_configuration/Resources/Private/Layouts/ 10.variables { mylabel = TEXT mylabel.value = Label from TypoScript coming }

Parameters

$conf : array = []

Array of TypoScript properties

Return values

string —

The HTML output

setRequest()

public setRequest(ServerRequestInterface $request) : void

Parameters

$request : ServerRequestInterface

applyStandardWrapToFluidPaths()

Applies stdWrap on Fluid path definitions

protected applyStandardWrapToFluidPaths(array $paths) : array

Parameters

$paths : array

Return values

array

applyStandardWrapToRenderedContent()

Apply standard wrap to content

protected applyStandardWrapToRenderedContent(string $content, array $conf) : string

Parameters

$content : string

Rendered HTML content

$conf : array

Configuration array

Return values

string —

Standard wrapped content

assignSettings()

Set any TypoScript settings to the view. This is similar to a default MVC action controller in extbase.

protected assignSettings(array $conf) : mixed

Parameters

$conf : array

Configuration

getContentObjectVariables()

Compile rendered content objects in variables array ready to assign to the view

protected getContentObjectVariables(array $conf) : array

Parameters

$conf : array

Configuration array

Tags

throws
InvalidArgumentException

Return values

array —

the variables to be assigned

hasTypoScriptFrontendController()

protected hasTypoScriptFrontendController() : bool

Return values

bool

initializeStandaloneViewInstance()

Creating standalone view instance must not be done in construct() as it can lead to a nasty cache issue since content object instances are not always re-created by the content object rendered for every usage, but can be re-used. Thus, we need a fresh instance of StandaloneView every time render() is called.

protected initializeStandaloneViewInstance() : mixed

renderFluidTemplateAssetsIntoPageRenderer()

Attempts to render HeaderAssets and FooterAssets sections from the Fluid template, then adds each (if not empty) to either header or footer, as appropriate, using PageRenderer.

protected renderFluidTemplateAssetsIntoPageRenderer() : mixed

renderFluidView()

Render fluid standalone view

protected renderFluidView() : string

Return values

string

setExtbaseVariables()

Set some extbase variables if given

protected setExtbaseVariables(array $conf) : mixed

Parameters

$conf : array

Configuration array

setFormat()

Set different format if given in configuration

protected setFormat(array $conf) : mixed

Parameters

$conf : array

Configuration array

setLayoutRootPath()

Set layout root path if given in configuration

protected setLayoutRootPath(array $conf) : mixed

Parameters

$conf : array

Configuration array

setPartialRootPath()

Set partial root path if given in configuration

protected setPartialRootPath(array $conf) : mixed

Parameters

$conf : array

Configuration array

setTemplate()

Set template

protected setTemplate(array $conf) : mixed

Parameters

$conf : array

With possibly set file resource

Tags

throws
InvalidArgumentException
On this page