function EntityDisplayModeFormBase::buildForm

Same name in other branches
  1. 10 core/modules/field_ui/src/Form/EntityDisplayModeFormBase.php \Drupal\field_ui\Form\EntityDisplayModeFormBase::buildForm()

Overrides EntityForm::buildForm

1 call to EntityDisplayModeFormBase::buildForm()
EntityDisplayModeAddForm::buildForm in core/modules/field_ui/src/Form/EntityDisplayModeAddForm.php
1 method overrides EntityDisplayModeFormBase::buildForm()
EntityDisplayModeAddForm::buildForm in core/modules/field_ui/src/Form/EntityDisplayModeAddForm.php

File

core/modules/field_ui/src/Form/EntityDisplayModeFormBase.php, line 73

Class

EntityDisplayModeFormBase
Provides the generic base class for entity display mode forms.

Namespace

Drupal\field_ui\Form

Code

public function buildForm(array $form, FormStateInterface $form_state, $entity_type_id = NULL) {
    if (!$entity_type_id && !$this->entity
        ->isNew()) {
        $entity_type_id = $this->entity
            ->getTargetType();
    }
    $this->targetEntityTypeId = $entity_type_id;
    return parent::buildForm($form, $form_state);
}

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