Drupal 8  8.0.2
FormErrorHandler Class Reference
Inheritance diagram for FormErrorHandler:

Public Member Functions

 __construct (TranslationInterface $string_translation, LinkGeneratorInterface $link_generator, RendererInterface $renderer)
 
- Public Member Functions inherited from FormErrorHandler
 handleFormErrors (array &$form, FormStateInterface $form_state)
 

Protected Member Functions

 displayErrorMessages (array $form, FormStateInterface $form_state)
 
- Protected Member Functions inherited from FormErrorHandler
 displayErrorMessages (array $form, FormStateInterface $form_state)
 
 setElementErrorsFromFormState (array &$elements, FormStateInterface &$form_state)
 
 drupalSetMessage ($message=NULL, $type= 'status', $repeat=FALSE)
 

Protected Attributes

 $renderer
 

Detailed Description

Produces inline form errors.

Constructor & Destructor Documentation

__construct ( TranslationInterface  $string_translation,
LinkGeneratorInterface  $link_generator,
RendererInterface  $renderer 
)

Constructs a new FormErrorHandler.

Parameters
\Drupal\Core\StringTranslation\TranslationInterface$string_translationThe string translation service.
\Drupal\Core\Utility\LinkGeneratorInterface$link_generatorThe link generation service.
\Drupal\Core\Render\RendererInterface$rendererThe renderer service.

References Drupal\linkGenerator().

Here is the call graph for this function:

Member Function Documentation

displayErrorMessages ( array  $form,
FormStateInterface  $form_state 
)
protected

Loops through and displays all form errors.

Parameters
array$formAn associative array containing the structure of the form.
\Drupal\Core\Form\FormStateInterface$form_stateThe current state of the form.

References FormErrorHandler\drupalSetMessage(), Url\fromRoute(), FormElementHelper\getElementByName(), FormElementHelper\getElementTitle(), FormStateInterface\getErrors(), Element\isVisibleElement(), and Drupal\l().

Here is the call graph for this function:


The documentation for this class was generated from the following file: