ipl\Controls: allow to prepend tabs

This commit is contained in:
Thomas Gelf 2017-07-29 00:13:43 +02:00
parent e1d766f112
commit 0e45c74a0c
1 changed files with 19 additions and 0 deletions

View File

@ -81,6 +81,25 @@ class Controls extends Container
return $this;
}
/**
* @param Tabs $tabs
* @return $this
*/
public function prependTabs(Tabs $tabs)
{
if ($this->tabs === null) {
$this->tabs = $tabs;
} else {
$current = $this->tabs->getTabs();
$this->tabs = $tabs;
foreach ($current as $name => $tab) {
$this->tabs->add($name, $tab);
}
}
return $this;
}
/**
* @return Html
*/