function SubformState::createForSubform

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

Creates a new instance for a subform.

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.

\Drupal\Core\Form\FormInterface|null $subform_form_object: The subform form object when it's not the same as the parent form.

Return value

static

55 calls to SubformState::createForSubform()
BlockForm::form in core/modules/block/src/BlockForm.php
BlockForm::submitForm in core/modules/block/src/BlockForm.php
BlockForm::submitVisibility in core/modules/block/src/BlockForm.php
Helper function to independently submit the visibility UI.
BlockForm::validateForm in core/modules/block/src/BlockForm.php
BlockForm::validateVisibility in core/modules/block/src/BlockForm.php
Helper function to independently validate the visibility UI.

... See full list

File

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

Class

SubformState
Stores information about the state of a subform.

Namespace

Drupal\Core\Form

Code

public static function createForSubform(array &$subform, array &$parent_form, FormStateInterface $parent_form_state, ?FormInterface $subform_form_object = NULL) {
  return new static($subform, $parent_form, $parent_form_state, $subform_form_object);
}

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