TYPO3 CMS  TYPO3_6-2
TYPO3\CMS\Fluid\ViewHelpers\RenderViewHelper Class Reference
Inheritance diagram for TYPO3\CMS\Fluid\ViewHelpers\RenderViewHelper:
TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper Tx_Fluid_ViewHelpers_RenderViewHelper

Public Member Functions

 render ($section=NULL, $partial=NULL, $arguments=array(), $optional=FALSE)
 
- Public Member Functions inherited from TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper
 setArguments (array $arguments)
 
 setRenderingContext (\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
 
 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 ()
 

Protected Member Functions

 loadSettingsIntoArguments ($arguments)
 
- 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 ()
 
 buildRenderChildrenClosure ()
 
 hasArgument ($argumentName)
 

Additional Inherited Members

- 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)
 
- 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 72 of file RenderViewHelper.php.

Member Function Documentation

◆ loadSettingsIntoArguments()

TYPO3\CMS\Fluid\ViewHelpers\RenderViewHelper::loadSettingsIntoArguments (   $arguments)
protected

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

Parameters
array$arguments
Returns
array

Definition at line 101 of file RenderViewHelper.php.

References TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper\$arguments.

Referenced by TYPO3\CMS\Fluid\ViewHelpers\RenderViewHelper\render().

◆ render()

TYPO3\CMS\Fluid\ViewHelpers\RenderViewHelper::render (   $section = NULL,
  $partial = NULL,
  $arguments = array(),
  $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.
boolean$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 84 of file RenderViewHelper.php.

References TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper\$arguments, and TYPO3\CMS\Fluid\ViewHelpers\RenderViewHelper\loadSettingsIntoArguments().