<?php

use kernel\App;
use kernel\CgRouteCollector;
use Phroute\Phroute\RouteCollector;

App::$collector->group(["prefix" => "admin"], function (CgRouteCollector $router) {
    App::$collector->group(["before" => "auth"], function (RouteCollector $router) {
        App::$collector->group(["prefix" => "user_stage"], function (CGRouteCollector $router) {
            App::$collector->get('/', [\app\modules\user_stage\controllers\UserStageController::class, 'actionIndex']);
            App::$collector->get('/page/{page_number}', [\app\modules\user_stage\controllers\UserStageController::class, 'actionIndex']);
            App::$collector->get('/create', [\app\modules\user_stage\controllers\UserStageController::class, 'actionCreate']);
            App::$collector->post("/", [\app\modules\user_stage\controllers\UserStageController::class, 'actionAdd']);
            App::$collector->get('/view/{id}', [\app\modules\user_stage\controllers\UserStageController::class, 'actionView']);
            App::$collector->any('/update/{id}', [\app\modules\user_stage\controllers\UserStageController::class, 'actionUpdate']);
            App::$collector->any("/edit/{id}", [\app\modules\user_stage\controllers\UserStageController::class, 'actionEdit']);
            App::$collector->get('/delete/{id}', [\app\modules\user_stage\controllers\UserStageController::class, 'actionDelete']);
            App::$collector->get('/set_stage/{stage_id}/{stage_status}/{user_id}', [\app\modules\user_stage\controllers\UserStageController::class, 'actionSetStage']);
        });
    });
});