admin init command
This commit is contained in:
@ -3,12 +3,32 @@
|
||||
namespace kernel\modules\menu;
|
||||
|
||||
use kernel\Module;
|
||||
use kernel\modules\menu\service\MenuService;
|
||||
|
||||
class MenuModule extends Module
|
||||
{
|
||||
|
||||
public function init()
|
||||
public MenuService $menuService;
|
||||
public function __construct()
|
||||
{
|
||||
// TODO: Implement init() method.
|
||||
$this->menuService = new MenuService();
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function init(): void
|
||||
{
|
||||
$this->menuService->createItem([
|
||||
"label" => "Меню",
|
||||
"url" => "/admin/settings/menu",
|
||||
"slug" => "menu",
|
||||
"parent_slug" => "settings"
|
||||
]);
|
||||
}
|
||||
|
||||
public function deactivate(): void
|
||||
{
|
||||
$this->menuService->removeItemBySlug("menu");
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user