public function VocabularyListController::buildForm

Form constructor.

Parameters

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

array $form_state: An associative array containing the current state of the form.

Return value

array The form structure.

Overrides FormInterface::buildForm

File

drupal/core/modules/taxonomy/lib/Drupal/taxonomy/VocabularyListController.php, line 115
Contains \Drupal\taxonomy\VocabularyListController.

Class

VocabularyListController
Provides a listing of vocabularies.

Namespace

Drupal\taxonomy

Code

public function buildForm(array $form, array &$form_state) {
  $form['vocabularies'] = array(
    '#type' => 'table',
    '#header' => $this
      ->buildHeader(),
    '#tabledrag' => array(
      array(
        'order',
        'sibling',
        'weight',
      ),
    ),
    '#attributes' => array(
      'id' => 'taxonomy',
    ),
  );
  foreach ($this
    ->load() as $entity) {
    $form['vocabularies'][$entity
      ->id()] = $this
      ->buildRow($entity);
  }
  $form['actions']['#type'] = 'actions';
  $form['actions']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Save'),
    '#button_type' => 'primary',
  );
  return $form;
}