TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
FluidTemplateContentObject Class Reference
Inheritance diagram for FluidTemplateContentObject:
AbstractContentObject

Public Member Functions

 __construct (ContentObjectRenderer $cObj)
 
 setContentDataProcessor ($contentDataProcessor)
 
 render ($conf=[])
 
- Public Member Functions inherited from AbstractContentObject
 __construct (ContentObjectRenderer $cObj)
 
 render ($conf=[])
 
 getContentObject ()
 
 getContentObjectRenderer ()
 

Protected Member Functions

 initializeStandaloneViewInstance ()
 
 setLayoutRootPath (array $conf)
 
 setPartialRootPath (array $conf)
 
 setFormat (array $conf)
 
 getContentObjectVariables (array $conf)
 
 renderFluidView ()
 
 applyStandardWrapToRenderedContent ($content, array $conf)
 
 applyStandardWrapToFluidPaths (array $paths)
 
- Protected Member Functions inherited from AbstractContentObject
 getPageRenderer ()
 

Protected Attributes

 $view = null
 
 $contentDataProcessor
 
- Protected Attributes inherited from AbstractContentObject
 $cObj
 
 $pageRenderer = null
 

Detailed Description

Contains FLUIDTEMPLATE class object

Definition at line 28 of file FluidTemplateContentObject.php.

Constructor & Destructor Documentation

__construct ( ContentObjectRenderer  $cObj)
Parameters
ContentObjectRenderer$cObj

Definition at line 43 of file FluidTemplateContentObject.php.

References GeneralUtility\makeInstance().

Member Function Documentation

applyStandardWrapToFluidPaths ( array  $paths)
protected

Applies stdWrap on Fluid path definitions

Parameters
array$paths
Returns
array

Definition at line 354 of file FluidTemplateContentObject.php.

References StringUtility\endsWith(), and GeneralUtility\getFileAbsFileName().

Referenced by FluidTemplateContentObject\setLayoutRootPath(), and FluidTemplateContentObject\setPartialRootPath().

applyStandardWrapToRenderedContent (   $content,
array  $conf 
)
protected

Apply standard wrap to content

Parameters
string$contentRendered HTML content
array$confConfiguration array
Returns
string Standard wrapped content

Definition at line 339 of file FluidTemplateContentObject.php.

Referenced by FluidTemplateContentObject\render().

getContentObjectVariables ( array  $conf)
protected

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

Parameters
array$confConfiguration array
Returns
array the variables to be assigned
Exceptions
InvalidArgumentException

Definition at line 281 of file FluidTemplateContentObject.php.

Referenced by FluidTemplateContentObject\render().

initializeStandaloneViewInstance ( )
protected

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.

Returns
void

Definition at line 121 of file FluidTemplateContentObject.php.

References GeneralUtility\makeInstance().

Referenced by FluidTemplateContentObject\render().

render (   $conf = [])

Rendering the cObject, FLUIDTEMPLATE

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/Patials/ 10.layoutRootPaths.10 = EXT:site_configuration/Resources/Private/Layouts/ 10.variables { mylabel = TEXT mylabel.value = Label from TypoScript coming }

Parameters
array$confArray of TypoScript properties
Returns
string The HTML output

Definition at line 85 of file FluidTemplateContentObject.php.

References FluidTemplateContentObject\$view, FluidTemplateContentObject\applyStandardWrapToRenderedContent(), FluidTemplateContentObject\getContentObjectVariables(), FluidTemplateContentObject\initializeStandaloneViewInstance(), FluidTemplateContentObject\renderFluidView(), FluidTemplateContentObject\setFormat(), FluidTemplateContentObject\setLayoutRootPath(), and FluidTemplateContentObject\setPartialRootPath().

renderFluidView ( )
protected

Render fluid standalone view

Returns
string

Definition at line 327 of file FluidTemplateContentObject.php.

Referenced by FluidTemplateContentObject\render().

setContentDataProcessor (   $contentDataProcessor)
Parameters
ContentDataProcessor$contentDataProcessor

Definition at line 52 of file FluidTemplateContentObject.php.

References FluidTemplateContentObject\$contentDataProcessor.

setFormat ( array  $conf)
protected

Set different format if given in configuration

Parameters
array$confConfiguration array
Returns
void

Definition at line 213 of file FluidTemplateContentObject.php.

Referenced by FluidTemplateContentObject\render().

setLayoutRootPath ( array  $conf)
protected

Set layout root path if given in configuration

Parameters
array$confConfiguration array
Returns
void

Definition at line 166 of file FluidTemplateContentObject.php.

References FluidTemplateContentObject\applyStandardWrapToFluidPaths(), and GeneralUtility\getFileAbsFileName().

Referenced by FluidTemplateContentObject\render().

setPartialRootPath ( array  $conf)
protected

Set partial root path if given in configuration

Parameters
array$confConfiguration array
Returns
void

Definition at line 190 of file FluidTemplateContentObject.php.

References FluidTemplateContentObject\applyStandardWrapToFluidPaths(), and GeneralUtility\getFileAbsFileName().

Referenced by FluidTemplateContentObject\render().

Member Data Documentation

$contentDataProcessor
protected
$view = null
protected

Definition at line 33 of file FluidTemplateContentObject.php.

Referenced by FluidTemplateContentObject\render().