public function attachComponent(AbsCmp $component, $position = self::CNR_BODY) { if ($position === self::CNR_BODY && !($component instanceof CmpTabForm || $component instanceof CmpTab)) { throw new \InvalidArgumentException('Component must be a tab instance'); } if ($component instanceof CmpTabForm || $component instanceof CmpTab) { if (!$this->activeTab) { $component->setActive(); $this->activeTab = $component; } $storedActive = $this->menuPage->getElementState($component->getTitle()); if ($storedActive) { $this->activeTab->setInactive(); $component->setActive(); $this->activeTab = $component; } else { $component->setInactive(); } } return parent::attachComponent($component, $position); }
/** * @return Twig * @author Panagiotis Vagenas <*****@*****.**> * @since 1.0.0 */ public function getTwig() { return $this->container->getTwig(); }
public function __construct(AbsMenuPage $menuPage, $position, $title) { parent::__construct($menuPage, $position); $this->setTitle($title); }