Package

ViewHelpers

ViewHelper Documentation

render

ViewHelper that renders a section or a specified partial

== Examples ==

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

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

<f:section name="mySection">

</f:section> <f:render section="mySection" arguments="{myMenu: menu}" />
  • menu1

    <ul>
      <li>menu1a</li>
      <li>menu1b</li>
    </ul>
    

  • [...] (depending on the value of {menu})

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

Arguments

section string, required

Name 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.

partial string, required

Reference to a partial.

arguments anySimpleType, required

Arguments to pass to the partial.

optional boolean, required

Set to TRUE, to ignore unknown sections, so the definition of a section inside a template can be optional for a layout

ViewHelper Resources

Schema Resources