31 lines
		
	
	
		
			617 B
		
	
	
	
		
			Plaintext
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			31 lines
		
	
	
		
			617 B
		
	
	
	
		
			Plaintext
		
	
	
		
			Executable File
		
	
	
	
	
| <?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}");
 | |
|     }
 | |
| } |