MicroFrameWork/kernel/templates/module_files/kernel_module_file_template
2024-12-10 17:01:25 +03:00

31 lines
617 B
Plaintext

<?php
namespace kernel\app_modules\{slug};
use kernel\helpers\Debug;
use kernel\Module;
use kernel\modules\menu\service\MenuService;
class {model}Module extends Module
{
public MenuService $menuService;
public function __construct()
{
$this->menuService = new MenuService();
}
public function init(): void
{
$this->menuService->createItem([
"label" => "{label}",
"url" => "/admin/{slug}",
"slug" => "{slug}",
]);
}
public function deactivate(): void
{
$this->menuService->removeItemBySlug("{slug}");
}
}