assertPermission('config/modules'); // // parent::init(); // } public function databaseAction() { $form = (new DatabaseConfigForm()) ->setIniConfig(Config::module('icingadb')); $form->handleRequest(); $this->mergeTabs($this->Module()->getConfigTabs()->activate('database')); $this->addFormToContent($form); } public function redisAction() { $form = (new RedisConfigForm()) ->setIniConfig($this->Config()); $form->handleRequest(); $this->mergeTabs($this->Module()->getConfigTabs()->activate('redis')); $this->addFormToContent($form); } protected function addFormToContent(Form $form) { $this->addContent(new HtmlString($form->render())); } protected function mergeTabs(Tabs $tabs): self { /** @var Tab $tab */ foreach ($tabs->getTabs() as $tab) { $this->tabs->add($tab->getName(), $tab); } return $this; } }