You are here

public function SubFormState::getError in Authorization 8

Returns the error message filed against the given form element.

Form errors higher up in the form structure override deeper errors as well as errors on the element itself.

Parameters

array $element: The form element to check for errors.

Return value

string|null Either the error message for this element or NULL if there are no errors.

Overrides FormStateInterface::getError

File

src/Form/SubFormState.php, line 388

Class

SubFormState
Represents the form state of a sub-form.

Namespace

Drupal\authorization\Form

Code

public function getError(array $element) {
  return $this->mainFormState
    ->getError($element);
}