MicroFrameWork/kernel/modules/post/routs/post.php

32 lines
2.3 KiB
PHP
Raw Normal View History

<?php
use kernel\App;
use Phroute\Phroute\RouteCollector;
App::$collector->group(["prefix" => "admin"], function (RouteCollector $router){
App::$collector->group(["prefix" => "post"], function (RouteCollector $router){
App::$collector->get('/', [\kernel\modules\post\controllers\PostController::class, 'actionIndex']);
App::$collector->get('/page/{page_number}', [\kernel\modules\post\controllers\PostController::class, 'actionIndex']);
App::$collector->get('/create', [\kernel\modules\post\controllers\PostController::class, 'actionCreate']);
App::$collector->post("/", [\kernel\modules\post\controllers\PostController::class, 'actionAdd']);
App::$collector->get('/{id}', [\kernel\modules\post\controllers\PostController::class, 'actionView']);
App::$collector->any('/update/{id}', [\kernel\modules\post\controllers\PostController::class, 'actionUpdate']);
App::$collector->any("/edit/{id}", [\kernel\modules\post\controllers\PostController::class, 'actionEdit']);
App::$collector->get('/delete/{id}', [\kernel\modules\post\controllers\PostController::class, 'actionDelete']);
});
2024-09-26 14:47:13 +03:00
});
App::$collector->group(["prefix" => "api"], function (RouteCollector $router){
App::$collector->group(["prefix" => "post"], function (RouteCollector $router){
App::$collector->get('/', [\kernel\modules\post\controllers\PostRestController::class, 'actionIndex']);
App::$collector->get('/{id}', [\kernel\modules\post\controllers\PostRestController::class, 'actionView']);
// App::$collector->get('/page/{page_number}', [\kernel\modules\post\controllers\PostController::class, 'actionIndex']);
// App::$collector->get('/create', [\kernel\modules\post\controllers\PostController::class, 'actionCreate']);
// App::$collector->post("/", [\kernel\modules\post\controllers\PostController::class, 'actionAdd']);
// App::$collector->get('/{id}', [\kernel\modules\post\controllers\PostController::class, 'actionView']);
// App::$collector->any('/update/{id}', [\kernel\modules\post\controllers\PostController::class, 'actionUpdate']);
// App::$collector->any("/edit/{id}", [\kernel\modules\post\controllers\PostController::class, 'actionEdit']);
// App::$collector->get('/delete/{id}', [\kernel\modules\post\controllers\PostController::class, 'actionDelete']);
});
});