function OverviewTermsOverride::buildForm

Form constructor.

Display a tree of all the terms in a vocabulary, with options to edit each one. The form is made drag and drop by the theme function.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

\Drupal\taxonomy\VocabularyInterface $taxonomy_vocabulary: The vocabulary to display the overview form for.

Return value

array The form structure.

Overrides OverviewTerms::buildForm

File

core/modules/taxonomy/tests/modules/taxonomy_overview_override_test/src/Form/OverviewTermsOverride.php, line 19

Class

OverviewTermsOverride
Provides an overview form to test overriding it via hook_entity_type_alter.

Namespace

Drupal\taxonomy_overview_override_test\Form

Code

public function buildForm(array $form, FormStateInterface $form_state, ?VocabularyInterface $taxonomy_vocabulary = NULL) {
  $form = parent::buildForm($form, $form_state, $taxonomy_vocabulary);
  $form['terms']['#empty'] = $this->t('No unicorns here, only llamas.');
  return $form;
}

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