function SubformState::setErrorByName

Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/Form/SubformState.php \Drupal\Core\Form\SubformState::setErrorByName()
  2. 10 core/lib/Drupal/Core/Form/SubformState.php \Drupal\Core\Form\SubformState::setErrorByName()
  3. 11.x core/lib/Drupal/Core/Form/SubformState.php \Drupal\Core\Form\SubformState::setErrorByName()

Overrides FormStateDecoratorBase::setErrorByName

File

core/lib/Drupal/Core/Form/SubformState.php, line 145

Class

SubformState
Stores information about the state of a subform.

Namespace

Drupal\Core\Form

Code

public function setErrorByName($name, $message = '') {
    $parents = $this->subform['#array_parents'];
    $parents[] = $name;
    $name = implode('][', $parents);
    parent::setErrorByName($name, $message);
    return $this;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.