function FieldLayoutEntityDisplayFormTrait::submitForm

Same name in other branches
  1. 9 core/modules/field_layout/src/Form/FieldLayoutEntityDisplayFormTrait.php \Drupal\field_layout\Form\FieldLayoutEntityDisplayFormTrait::submitForm()
  2. 8.9.x core/modules/field_layout/src/Form/FieldLayoutEntityDisplayFormTrait.php \Drupal\field_layout\Form\FieldLayoutEntityDisplayFormTrait::submitForm()
  3. 11.x core/modules/field_layout/src/Form/FieldLayoutEntityDisplayFormTrait.php \Drupal\field_layout\Form\FieldLayoutEntityDisplayFormTrait::submitForm()

Overrides \Drupal\field_ui\Form\EntityDisplayFormBase::submitForm().

File

core/modules/field_layout/src/Form/FieldLayoutEntityDisplayFormTrait.php, line 158

Class

FieldLayoutEntityDisplayFormTrait
Provides shared code for entity display forms.

Namespace

Drupal\field_layout\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
    parent::submitForm($form, $form_state);
    $entity = $this->getEntity();
    $layout_plugin = $this->getLayout($entity, $form_state);
    if ($layout_plugin instanceof PluginFormInterface) {
        $subform_state = SubformState::createForSubform($form['field_layouts']['settings_wrapper']['layout_settings'], $form, $form_state);
        $layout_plugin->submitConfigurationForm($form['field_layouts']['settings_wrapper']['layout_settings'], $subform_state);
    }
    $entity->setLayout($layout_plugin);
}

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