TYPO3CMS  8
 All Classes Namespaces Files Functions Variables Pages
FormView Class Reference
Inheritance diagram for FormView:
AbstractTemplateView TemplateView ViewInterface

Public Member Functions

 setFormRuntime (FormRuntime $formRuntime)
 
 getFormRuntime ()
 
 renderRenderable (RootRenderableInterface $renderable)
 
- Public Member Functions inherited from AbstractTemplateView
 initializeView ()
 
 __construct (RenderingContextInterface $context=null)
 
 canRender (\TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext $controllerContext)
 
 setControllerContext (\TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext $controllerContext)
 
- Public Member Functions inherited from TemplateView
 initializeView ()
 
 setTemplate ($templateName)
 
 setTemplatePathAndFilename ($templatePathAndFilename)
 
 setLayoutPathAndFilename ($layoutPathAndFilename)
 
 getTemplateRootPaths ()
 
 setTemplateRootPaths (array $templateRootPaths)
 
 setPartialRootPaths (array $partialRootPaths)
 
 setLayoutRootPaths (array $layoutRootPaths)
 
 canRender (ControllerContext $controllerContext)
 
- Public Member Functions inherited from ViewInterface
 setControllerContext (\TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext $controllerContext)
 
 assign ($key, $value)
 
 assignMultiple (array $values)
 
 canRender (\TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext $controllerContext)
 
 render ()
 

Protected Member Functions

 renderPreviewMode (string $output, RootRenderableInterface $renderable)
 

Protected Attributes

 $formRuntime
 
- Protected Attributes inherited from AbstractTemplateView
 $controllerContext
 

Detailed Description

A fluid TemplateView implementation which used to render Renderables.

The FormView is especially capable of rendering nested renderables as well, i.e a form with a page, with all FormElements.

Options

The FormView uses some rendering options which are of particular importance, as they determine how the form field is resolved to a path in the file system.

All rendering options are retrieved from the renderable which shall be rendered, using the TYPO3\CMS\Form\Domain\Model\Renderable\RenderableInterface::getRenderingOptions()method.<h2>templateRootPaths</h2>Usedtodefineseveralpathsfortemplates,whichwillbetriedinreversedorder(thepathsaresearchedfrombottomtotop).Thefirstfolderwherethedesiredlayoutisfound,isused.Ifthearraykeysarenumeric,theyarefirstsortedandthentriedinreversedorder.<h2>layoutRootPaths</h2>Usedtodefineseveralpathsforlayouts,whichwillbetriedinreversedorder(thepathsaresearchedfrombottomtotop).Thefirstfolderwherethedesiredlayoutisfound,isused.Ifthearraykeysarenumeric,theyarefirstsortedandthentriedinreversedorder.<h2>partialRootPaths</h2>Usedtodefineseveralpathsforpartials,whichwillbetriedinreversedorder.Thefirstfolderwherethedesiredpartialisfound,isused.Thekeysofthearraydefinetheorder.<h2>renderableNameInTemplate</h2>Thisisamostly-internalsettingwhichcontrolsthenameunderwhichthecurrentrenderableismadeavailableinsidethetemplate.Forexample,itcontrolsthatinsidethetemplateofa"Page",thePageobjectisavailableusingthevariable<em>page</em>.<h1>RenderingChildRenderables</h1>Ifarenderablewantstorenderchildrenderables,insideitstemplate,itcandothatusingthe<code><formvh:renderRenderable></code>ViewHelper.AtemplateexamplefromPageshalldemonstratethis:<pre>namespaceformvh=TYPO3\CMS\Form\ViewHelpers<f:foreach="page.elements"as="element"><formvh:renderRenderablerenderable="element"/></f:for></pre><h1>RenderingPHPBasedChildRenderables</h1>Ifachildrenderablehasa<em>rendererClassName</em>set(i.e.@link\TYPO3\CMS\Form\Domain\Model\FormElements\FormElementInterface::getRendererClassName()returnsanon-NULLstring),thisrendererisautomaticallyinstanciatedandtherenderingforthiselementisdelegatedtothisRenderer.Scope:frontend<strong>ThisclassisNOTmeanttobesubclassedbydevelopers.</strong>

Definition at line 101 of file FormView.php.

Member Function Documentation

getFormRuntime ( )
Returns
FormRuntime

Definition at line 123 of file FormView.php.

References FormView\$formRuntime.

renderPreviewMode ( string  $output,
RootRenderableInterface  $renderable 
)
protected

Wrap every renderable with a span with a identifier path data attribute.

Parameters
string$output
RootRenderableInterface$renderable
Returns
string

Definition at line 218 of file FormView.php.

References RootRenderableInterface\getIdentifier().

Referenced by FormView\renderRenderable().

renderRenderable ( RootRenderableInterface  $renderable)

Render the $renderable and return the content.

Parameters
RootRenderable$renderable
Returns
string
Exceptions
RenderingException

Definition at line 136 of file FormView.php.

References RootRenderableInterface\beforeRendering(), RootRenderableInterface\getRendererClassName(), RootRenderableInterface\getRenderingOptions(), RootRenderableInterface\getType(), GeneralUtility\makeInstance(), ViewInterface\render(), and FormView\renderPreviewMode().

setFormRuntime ( FormRuntime  $formRuntime)
Parameters
FormRuntime$formRuntime
Returns
void

Definition at line 114 of file FormView.php.

References FormView\$formRuntime.

Member Data Documentation

$formRuntime
protected

Definition at line 107 of file FormView.php.

Referenced by FormView\getFormRuntime(), and FormView\setFormRuntime().