TYPO3 CMS  TYPO3_7-6
TYPO3\CMS\Fluid\ViewHelpers\RenderViewHelper Class Reference
Inheritance diagram for TYPO3\CMS\Fluid\ViewHelpers\RenderViewHelper:
TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface

Public Member Functions

 render ($section=null, $partial=null, $arguments=[], $optional=false)
 
- Public Member Functions inherited from TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper
 setArguments (array $arguments)
 
 setRenderingContext (\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
 
 injectObjectManager (\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager)
 
 injectReflectionService (\TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService)
 
 isEscapingInterceptorEnabled ()
 
 setViewHelperNode (\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode $node)
 
 setRenderChildrenClosure (\Closure $renderChildrenClosure)
 
 initializeArgumentsAndRender ()
 
 initialize ()
 
 renderChildren ()
 
 prepareArguments ()
 
 validateArguments ()
 
 initializeArguments ()
 
 compile ($argumentsVariableName, $renderChildrenClosureVariableName, &$initializationPhpCode, \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode $syntaxTreeNode, \TYPO3\CMS\Fluid\Core\Compiler\TemplateCompiler $templateCompiler)
 
 resetState ()
 
- Public Member Functions inherited from TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface
 compile ($argumentsVariableName, $renderChildrenClosureVariableName, &$initializationPhpCode, \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode $syntaxTreeNode, \TYPO3\CMS\Fluid\Core\Compiler\TemplateCompiler $templateCompiler)
 

Static Public Member Functions

static renderStatic (array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
 
- Static Public Member Functions inherited from TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper
static renderStatic (array $arguments, \Closure $renderChildrenClosure, \TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
 
- Static Public Member Functions inherited from TYPO3\CMS\Fluid\Core\ViewHelper\Facets\CompilableInterface
static renderStatic (array $arguments, \Closure $renderChildrenClosure, \TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
 

Static Protected Member Functions

static loadSettingsIntoArguments ($arguments, RenderingContextInterface $renderingContext)
 

Additional Inherited Members

- Protected Member Functions inherited from TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper
 registerArgument ($name, $type, $description, $required=false, $defaultValue=null)
 
 overrideArgument ($name, $type, $description, $required=false, $defaultValue=null)
 
 callRenderMethod ()
 
 getLogger ()
 
 buildRenderChildrenClosure ()
 
 hasArgument ($argumentName)
 
- Protected Attributes inherited from TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper
 $arguments
 
 $templateVariableContainer
 
 $controllerContext
 
 $renderingContext
 
 $renderChildrenClosure = null
 
 $viewHelperVariableContainer
 
 $objectManager
 
 $escapingInterceptorEnabled = true
 

Detailed Description

ViewHelper that renders a section or a specified partial

== Examples ==

<f:render partial="SomePartial" arguments="{foo: someVariable}" /> <output> the content of the partial "SomePartial". The content of the variable {someVariable} will be available in the partial as {foo} </output>

<f:section name="someSection">This is a section. {foo}</f:section> <f:render section="someSection" arguments="{foo: someVariable}" /> <output> the content of the section "someSection". The content of the variable {someVariable} will be available in the partial as {foo} </output>

<f:section name="mySection">

f:for each="{myMenu}" as="menuItem"> {menuItem.text} <f:if condition="{menuItem.subItems}"> <f:render section="mySection" arguments="{myMenu: menuItem.subItems}" /> </f:if> </f:for> </f:section> <f:render section="mySection" arguments="{myMenu: menu}" /> <output>

  • menu1

    • menu1a
    • menu1b

    [...] (depending on the value of {menu}) </output>

    <f:render partial="somePartial" arguments="{_all}" /> <output> the content of the partial "somePartial". Using the reserved keyword "_all", all available variables will be passed along to the partial </output>

Definition at line 76 of file RenderViewHelper.php.

Member Function Documentation

◆ loadSettingsIntoArguments()

static TYPO3\CMS\Fluid\ViewHelpers\RenderViewHelper::loadSettingsIntoArguments (   $arguments,
RenderingContextInterface  $renderingContext 
)
staticprotected

If $arguments['settings'] is not set, it is loaded from the TemplateVariableContainer (if it is available there).

Parameters
array$arguments
RenderingContextInterface$renderingContext
Returns
array

Definition at line 134 of file RenderViewHelper.php.

References TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper\$arguments, TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper\$templateVariableContainer, and TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface\getTemplateVariableContainer().

◆ render()

TYPO3\CMS\Fluid\ViewHelpers\RenderViewHelper::render (   $section = null,
  $partial = null,
  $arguments = [],
  $optional = false 
)

Renders the content.

Parameters
string$sectionName of section to render. If used in a layout, renders a section of the main content file. If used inside a standard template, renders a section of the same file.
string$partialReference to a partial.
array$argumentsArguments to pass to the partial.
bool$optionalSet to TRUE, to ignore unknown sections, so the definition of a section inside a template can be optional for a layout
Returns
string

Definition at line 88 of file RenderViewHelper.php.

References TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper\$arguments, and TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper\buildRenderChildrenClosure().

◆ renderStatic()

static TYPO3\CMS\Fluid\ViewHelpers\RenderViewHelper::renderStatic ( array  $arguments,
\Closure  $renderChildrenClosure,
RenderingContextInterface  $renderingContext 
)
static

Renders the content.

Parameters
array$arguments
\Closure$renderChildrenClosure
RenderingContextInterface$renderingContext
Returns
string

Definition at line 110 of file RenderViewHelper.php.

References TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper\$viewHelperVariableContainer, and TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface\getViewHelperVariableContainer().