igfs/kernel/modules/post/PostModule.php

30 lines
604 B
PHP
Raw Normal View History

2024-09-12 16:01:04 +03:00
<?php
namespace kernel\modules\post;
use kernel\helpers\Debug;
2024-09-12 16:01:04 +03:00
use kernel\Module;
use kernel\modules\menu\service\MenuService;
2024-09-12 16:01:04 +03:00
class PostModule extends Module
{
public MenuService $menuService;
public function __construct()
{
$this->menuService = new MenuService();
}
public function init(): void
{
$this->menuService->createItem([
"label" => "Посты",
"url" => "/admin/post",
"slug" => "post",
]);
}
2024-09-12 16:01:04 +03:00
public function deactivate(): void
2024-09-12 16:01:04 +03:00
{
$this->menuService->removeItemBySlug("post");
2024-09-12 16:01:04 +03:00
}
}