You are here

public function SubFormState::setError in Authorization 8

Flags an element as having an error.

Parameters

array $element: The form element.

string $message: (optional) The error message to present to the user.

Return value

$this

Overrides FormStateInterface::setError

File

src/Form/SubFormState.php, line 366

Class

SubFormState
Represents the form state of a sub-form.

Namespace

Drupal\authorization\Form

Code

public function setError(array &$element, $message = '') {
  $this->mainFormState
    ->setError($element, $message);
  return $this;
}