You are here

public function HomeboxSettingsForm::form in Homebox 8

Gets the actual form array to be built.

Overrides EntityForm::form

See also

\Drupal\Core\Entity\EntityForm::processForm()

\Drupal\Core\Entity\EntityForm::afterBuild()

File

src/Form/HomeboxSettingsForm.php, line 135

Class

HomeboxSettingsForm
Class HomeboxForm.

Namespace

Drupal\homebox\Form

Code

public function form(array $form, FormStateInterface $form_state) {
  $form['#attached']['library'][] = 'core/drupal.tableheader';
  $form['#attached']['library'][] = 'block/drupal.block';
  $form['#attached']['library'][] = 'block/drupal.block.admin';
  $form['#attributes']['class'][] = 'clearfix';

  // Build the form tree.
  $form['blocks'] = $this
    ->buildBlocksForm();
  $form['actions'] = [
    '#tree' => FALSE,
    '#type' => 'actions',
  ];
  $form['actions']['submit'] = [
    '#type' => 'submit',
    '#value' => $this
      ->t('Save blocks'),
    '#button_type' => 'primary',
  ];
  return $form;
}