SubformStateInterface

Stores information about the state of a subform. In the context of Drupal's Form API, a subform is a form definition array that will be nested into a "parent" form. For instance: $subform = [ 'method' => [ '#type' => 'select', // … ], ]; $form = [ // … 'settings' => $subform, ]; All input fields nested under "settings" are then considered part of that "subform". The concept is used mostly when the subform is defined by a different class (potentially even in a differen

SubformState::__construct

protected SubformState::__construct(array &$subform, array &$parent_form, FormStateInterface $parent_form_state) Constructs a new instance. Parameters mixed[] $subform: The subform for which to create a form state. mixed[] $parent_form: The subform's parent form. \Drupal\Core\Form\FormStateInterface $parent_form_state: The parent form state. File core/lib/Drupal/Core/Form/SubformState.php, line 38 Class SubformState Stores information about the state of a subform. Namespace Dru

SubformState::getValues

public &SubformState::getValues() Implements \Drupal\Core\Form\FormStateInterface::getValues() Overrides FormStateValuesTrait::getValues File core/lib/Drupal/Core/Form/SubformState.php, line 99 Class SubformState Stores information about the state of a subform. Namespace Drupal\Core\Form Code public function &getValues() { $exists = NULL; $values = &NestedArray::getValue(parent::getValues(), $this->getParents('#parents'), $exists); if (!$exists) { $values = [];

SubformState::getParents

protected SubformState::getParents($property) Gets the subform's parents relative to its parent form. Parameters string $property: The property name (#parents or #array_parents). Return value mixed Throws \InvalidArgumentException Thrown when the requested property does not exist. \UnexpectedValueException Thrown when the subform is not contained by the given parent form. File core/lib/Drupal/Core/Form/SubformState.php, line 73 Class SubformState Stores information about the state of a

SubformState::getLimitValidationErrors

public SubformState::getLimitValidationErrors() Retrieves the limited validation error sections. Return value array|null The limited validation error sections. Overrides FormStateDecoratorBase::getLimitValidationErrors See also \Drupal\Core\Form\FormState::$limit_validation_errors File core/lib/Drupal/Core/Form/SubformState.php, line 133 Class SubformState Stores information about the state of a subform. Namespace Drupal\Core\Form Code public function getLimitValidationErrors() { $

SubformState::setLimitValidationErrors

public SubformState::setLimitValidationErrors($limit_validation_errors) Sets the limited validation error sections. Parameters array|null $limit_validation_errors: The limited validation error sections. Return value $this Overrides FormStateDecoratorBase::setLimitValidationErrors See also \Drupal\Core\Form\FormState::$limit_validation_errors File core/lib/Drupal/Core/Form/SubformState.php, line 122 Class SubformState Stores information about the state of a subform. Namespace Drupal\C

SubformState::setErrorByName

public SubformState::setErrorByName($name, $message = '') Files an error against a form element. When a validation error is detected, the validator calls this method to indicate which element needs to be changed and provide an error message. This causes the Form API to not execute the form submit handlers, and instead to re-display the form to the user with the corresponding elements rendered with an 'error' CSS class (shown as red by default). The standard behavior of this method can be change

SubformState::getCompleteFormState

public SubformState::getCompleteFormState() Gets the complete form state. Return value \Drupal\Core\Form\FormStateInterface Overrides SubformStateInterface::getCompleteFormState File core/lib/Drupal/Core/Form/SubformState.php, line 115 Class SubformState Stores information about the state of a subform. Namespace Drupal\Core\Form Code public function getCompleteFormState() { return $this->decoratedFormState instanceof SubformStateInterface ? $this->decoratedFormState->getCom

SubformState::$subform

The subform. Type: mixed[] File core/lib/Drupal/Core/Form/SubformState.php, line 26 Class SubformState Stores information about the state of a subform. Namespace Drupal\Core\Form Code protected $subform;

SubformState::$parentForm

The parent form. Type: mixed[] File core/lib/Drupal/Core/Form/SubformState.php, line 19 Class SubformState Stores information about the state of a subform. Namespace Drupal\Core\Form Code protected $parentForm;