You are here

public function TabAddForm::buildForm in Block Tabs 8

Parameters

\Drupal\blocktabs\BlocktabsInterface $blocktabs: The block tabs.

string $tab: The tab ID.

Return value

array The form structure.

Throws

\Symfony\Component\HttpKernel\Exception\NotFoundHttpException

Overrides TabFormBase::buildForm

File

src/Form/TabAddForm.php, line 44

Class

TabAddForm
Provides an add form for tab.

Namespace

Drupal\blocktabs\Form

Code

public function buildForm(array $form, FormStateInterface $form_state, BlocktabsInterface $blocktabs = NULL, $tab = NULL) {
  $form = parent::buildForm($form, $form_state, $blocktabs, $tab);

  // drupal_set_message('term_id:' . var_export($tab));
  $form['#title'] = $this
    ->t('Add %label tab', [
    '%label' => $this->tab
      ->label(),
  ]);
  $form['actions']['submit']['#value'] = $this
    ->t('Add tab');
  return $form;
}