From 0e45c74a0c83a31dfd091c59c472aafaa32122ad Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Sat, 29 Jul 2017 00:13:43 +0200 Subject: [PATCH] ipl\Controls: allow to prepend tabs --- library/vendor/ipl/Web/Widget/Controls.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/library/vendor/ipl/Web/Widget/Controls.php b/library/vendor/ipl/Web/Widget/Controls.php index 3ff12b19..7e381fd0 100644 --- a/library/vendor/ipl/Web/Widget/Controls.php +++ b/library/vendor/ipl/Web/Widget/Controls.php @@ -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 */