function ViewFormBase::buildForm

Same name in other branches
  1. 8.9.x core/modules/views_ui/src/ViewFormBase.php \Drupal\views_ui\ViewFormBase::buildForm()
  2. 10 core/modules/views_ui/src/ViewFormBase.php \Drupal\views_ui\ViewFormBase::buildForm()
  3. 11.x core/modules/views_ui/src/ViewFormBase.php \Drupal\views_ui\ViewFormBase::buildForm()

Overrides EntityForm::buildForm

File

core/modules/views_ui/src/ViewFormBase.php, line 36

Class

ViewFormBase
Base form for Views forms.

Namespace

Drupal\views_ui

Code

public function buildForm(array $form, FormStateInterface $form_state, $display_id = NULL) {
    if (isset($display_id) && $form_state->has('display_id') && $display_id !== $form_state->get('display_id')) {
        throw new \InvalidArgumentException('Mismatch between $form_state->get(\'display_id\') and $display_id.');
    }
    $this->displayID = $form_state->has('display_id') ? $form_state->get('display_id') : $display_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.