You are here

protected function TabAddForm::prepareTab in Block Tabs 8

Converts a tab ID into an object.

Parameters

string $tab: The tab ID.

Return value

\Drupal\blocktabs\TabInterface The tab object.

Overrides TabFormBase::prepareTab

File

src/Form/TabAddForm.php, line 56

Class

TabAddForm
Provides an add form for tab.

Namespace

Drupal\blocktabs\Form

Code

protected function prepareTab($tab) {
  $tab = $this->tabManager
    ->createInstance($tab);

  // Set the initial weight so this tab comes last.
  $tab
    ->setWeight(count($this->blocktabs
    ->getTabs()));
  return $tab;
}