function 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 77 
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);
}Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.
