igmf/kernel/modules/themes/ThemesModule.php
2025-01-15 16:57:03 +03:00

33 lines
688 B
PHP

<?php
namespace kernel\modules\themes;
use kernel\Module;
use kernel\modules\menu\service\MenuService;
class ThemesModule extends Module
{
public MenuService $menuService;
public function __construct()
{
$this->menuService = new MenuService();
}
/**
* @throws \Exception
*/
public function init(): void
{
$this->menuService->createItem([
"label" => "Темы сайта",
"url" => "/admin/settings/themes",
"slug" => "themes",
"parent_slug" => "settings"
]);
}
public function deactivate(): void
{
$this->menuService->removeItemBySlug("themes");
}
}