.. include:: /Includes.rst.txt .. _typo3fluid-fluid-render: ============================== render ViewHelper `` ============================== A ViewHelper to render a section, a partial, a specified section in a partial or a delegate ParsedTemplateInterface implementation. Examples ======== Rendering partials ------------------ :: Output:: the content of the partial "SomePartial". The content of the variable {someVariable} will be available in the partial as {foo} Rendering sections ------------------ :: This is a section. {foo} Output:: the content of the section "someSection". The content of the variable {someVariable} will be available in the partial as {foo} Rendering recursive sections ---------------------------- ::
  • {menuItem.text}
Output::
  • menu1
    • menu1a
    • menu1b
  • [...] (depending on the value of {menu}) Passing all variables to a partial ---------------------------------- :: Output:: the content of the partial "somePartial". Using the reserved keyword "_all", all available variables will be passed along to the partial Rendering via a delegate ParsedTemplateInterface implementation w/ custom arguments ----------------------------------------------------------------------------------- :: This will output whichever output was generated by calling ``My\Special\ParsedTemplateImplementation->render()`` with cloned RenderingContextInterface $renderingContext as only argument and content of arguments assigned in VariableProvider of cloned context. Supports all other input arguments including recursive rendering, contentAs argument, default value etc. Note that while ParsedTemplateInterface supports returning a Layout name, this Layout will not be respected when rendering using this method. Only the ``render()`` method will be called! .. _typo3fluid-fluid-render_arguments: Arguments ========= .. _render_section: section ------- :aspect:`DataType` string :aspect:`Required` false :aspect:`Description` Section to render - combine with partial to render section in partial .. _render_partial: partial ------- :aspect:`DataType` string :aspect:`Required` false :aspect:`Description` Partial to render, with or without section .. _render_delegate: delegate -------- :aspect:`DataType` string :aspect:`Required` false :aspect:`Description` Optional PHP class name of a permanent, included-in-app ParsedTemplateInterface implementation to override partial/section .. _render_arguments: arguments --------- :aspect:`DataType` mixed :aspect:`Default` array () :aspect:`Required` false :aspect:`Description` Array of variables to be transferred. Use {_all} for all variables .. _render_optional: optional -------- :aspect:`DataType` boolean :aspect:`Required` false :aspect:`Description` If TRUE, considers the *section* optional. Partial never is. .. _render_default: default ------- :aspect:`DataType` mixed :aspect:`Required` false :aspect:`Description` Value (usually string) to be displayed if the section or partial does not exist .. _render_contentas: contentAs --------- :aspect:`DataType` string :aspect:`Required` false :aspect:`Description` If used, renders the child content and adds it as a template variable with this name for use in the partial/section