HasErrorsViewHelper extends AbstractConditionViewHelper
FinalYes
ViewHelper which checks whether a property has validation errors, implemented as a condition like an "if" construct. Errors of sub properties count as well, so "author" is true if only "author.email" has an error.
<div class="{f:form.hasErrors(for: 'blog.title', then: 'has-error')}">
<f:form.textfield property="title" />
</div>
<f:form.hasErrors for="blog.title">
<f:then>
The title has at least one validation error.
</f:then>
<f:else>
The title is fine.
</f:else>
</f:form.hasErrors>
Use <f:form.validationResults> instead to access the error objects themselves.
Tags
Table of Contents
Methods
- initializeArguments() : void
- verdict() : bool
Methods
initializeArguments()
public
initializeArguments() : void
verdict()
public
static verdict(array $arguments, RenderingContextInterface $renderingContext) : bool
Parameters
- $arguments : array
- $renderingContext : RenderingContextInterface