Form constructor.
array $form: An associative array containing the structure of the form.
array $form_state: An associative array containing the current state of the form.
array The form structure.
Overrides FormInterface::buildForm
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;
}