TYPO3 CMS  TYPO3_6-2
TYPO3\CMS\Fluid\ViewHelpers\Form\ValidationResultsViewHelper Class Reference
Inheritance diagram for TYPO3\CMS\Fluid\ViewHelpers\Form\ValidationResultsViewHelper:
TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper Tx_Fluid_ViewHelpers_Form_ValidationResultsViewHelper

Public Member Functions

 render ($for='', $as='validationResults')
 
- 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 ()
 

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 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)
 
- Protected Attributes inherited from TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper
 $arguments
 
 $templateVariableContainer
 
 $controllerContext
 
 $renderingContext
 
 $renderChildrenClosure = NULL
 
 $viewHelperVariableContainer
 
 $objectManager
 
 $escapingInterceptorEnabled = TRUE
 

Detailed Description

Validation results view helper

= Examples =

<f:form.validationResults> <f:if condition="{validationResults.flattenedErrors}">

f:for each="{validationResults.flattenedErrors}" as="errors" key="propertyPath"> {propertyPath}

f:for each="{errors}" as="error"> {error.code}: {error} </f:for> </f:for> </f:if> </f:form.validationResults> <output>

  • 1234567890: Validation errors for argument "newBlog"

</output>

<f:form.validationResults for="someProperty"> <f:if condition="{validationResults.flattenedErrors}">

f:for each="{validationResults.errors}" as="error"> {error.code}: {error} </f:for> </f:if> </f:form.validationResults> <output>

  • 1234567890: Some error message

</output>

Definition at line 71 of file ValidationResultsViewHelper.php.

Member Function Documentation

◆ render()

TYPO3\CMS\Fluid\ViewHelpers\Form\ValidationResultsViewHelper::render (   $for = '',
  $as = 'validationResults' 
)

Iterates through selected errors of the request.

Parameters
string$forThe name of the error name (e.g. argument name or property name). This can also be a property path (like blog.title), and will then only display the validation errors of that property.
string$asThe name of the variable to store the current error
Returns
string Rendered string

Definition at line 81 of file ValidationResultsViewHelper.php.

References TYPO3\CMS\Fluid\Core\ViewHelper\AbstractViewHelper\renderChildren().