MicroFrameWork/kernel/modules/menu/routs/menu.php

29 lines
1.7 KiB
PHP
Raw Normal View History

2024-09-18 13:48:12 +03:00
<?php
use kernel\App;
2024-10-07 16:13:46 +03:00
use kernel\CgRouteCollector;
2024-09-18 13:48:12 +03:00
use Phroute\Phroute\RouteCollector;
2024-10-17 14:55:00 +03:00
App::$collector->filter("auth", [\kernel\middlewares\AuthMiddleware::class, "handler"]);
2024-09-18 13:48:12 +03:00
App::$collector->group(["prefix" => "admin"], function (RouteCollector $router) {
2024-10-17 14:55:00 +03:00
App::$collector->group(["before" => "auth"], function (RouteCollector $router){
App::$collector->group(["prefix" => "settings"], function (RouteCollector $router){
App::$collector->group(["prefix" => "menu"], function (RouteCollector $router){
App::$collector->get('/', [\kernel\modules\menu\controllers\MenuController::class, 'actionIndex']);
App::$collector->get('/page/{page_number}', [\kernel\modules\menu\controllers\MenuController::class, 'actionIndex']);
App::$collector->get('/create', [\kernel\modules\menu\controllers\MenuController::class, 'actionCreate']);
App::$collector->post("/", [\kernel\modules\menu\controllers\MenuController::class, 'actionAdd']);
App::$collector->get('/{id}', [\kernel\modules\menu\controllers\MenuController::class, 'actionView']);
App::$collector->any('/update/{id}', [\kernel\modules\menu\controllers\MenuController::class, 'actionUpdate']);
App::$collector->any("/edit/{id}", [\kernel\modules\menu\controllers\MenuController::class, 'actionEdit']);
App::$collector->get('/delete/{id}', [\kernel\modules\menu\controllers\MenuController::class, 'actionDelete']);
});
2024-09-18 13:48:12 +03:00
});
});
2024-10-17 14:55:00 +03:00
2024-10-07 16:13:46 +03:00
});
App::$collector->group(["prefix" => "api"], function (CgRouteCollector $router){
$router->rest("menu", [\kernel\modules\menu\controllers\MenuRestController::class]);
2024-09-18 13:48:12 +03:00
});