protected function OverridesEntityForm::init in Drupal 8
Same name and namespace in other branches
- 9 core/modules/layout_builder/src/Form/OverridesEntityForm.php \Drupal\layout_builder\Form\OverridesEntityForm::init()
- 10 core/modules/layout_builder/src/Form/OverridesEntityForm.php \Drupal\layout_builder\Form\OverridesEntityForm::init()
Initializes the form state and the entity before the first form build.
Parameters
\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.
Overrides ContentEntityForm::init
File
- core/
modules/ layout_builder/ src/ Form/ OverridesEntityForm.php, line 81
Class
- OverridesEntityForm
- Provides a form containing the Layout Builder UI for overrides.
Namespace
Drupal\layout_builder\FormCode
protected function init(FormStateInterface $form_state) {
parent::init($form_state);
$form_display = EntityFormDisplay::collectRenderDisplay($this->entity, $this
->getOperation(), FALSE);
$form_display
->setComponent(OverridesSectionStorage::FIELD_NAME, [
'type' => 'layout_builder_widget',
'weight' => -10,
'settings' => [],
]);
$this
->setFormDisplay($form_display, $form_state);
}