<?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" => "custom_field"], function (CGRouteCollector $router) {
            App::$collector->get('/', [\app\modules\user_custom_fields\controllers\UserCustomFieldsController::class, 'actionIndex']);
            App::$collector->get('/page/{page_number}', [\app\modules\user_custom_fields\controllers\UserCustomFieldsController::class, 'actionIndex']);
            App::$collector->get('/create', [\app\modules\user_custom_fields\controllers\UserCustomFieldsController::class, 'actionCreate']);
            App::$collector->post("/", [\app\modules\user_custom_fields\controllers\UserCustomFieldsController::class, 'actionAdd']);
            App::$collector->get('/view/{id}', [\app\modules\user_custom_fields\controllers\UserCustomFieldsController::class, 'actionView']);
            App::$collector->any('/update/{id}', [\app\modules\user_custom_fields\controllers\UserCustomFieldsController::class, 'actionUpdate']);
            App::$collector->any("/edit/{id}", [\app\modules\user_custom_fields\controllers\UserCustomFieldsController::class, 'actionEdit']);
            App::$collector->get('/delete/{id}', [\app\modules\user_custom_fields\controllers\UserCustomFieldsController::class, 'actionDelete']);
            App::$collector->get('/user_values', [\app\modules\user_custom_fields\controllers\UserCustomFieldsController::class, 'actionUserCustomValuesList']);
            App::$collector->post('/user_values', [\app\modules\user_custom_fields\controllers\UserCustomFieldsController::class, 'actionAddUserCustomValues']);
            App::$collector->get('/user_values/create', [\app\modules\user_custom_fields\controllers\UserCustomFieldsController::class, 'actionCreateUserCustomValues']);
            App::$collector->get('/user_values/delete/{id}', [\app\modules\user_custom_fields\controllers\UserCustomFieldsController::class, 'actionDeleteUserCustomValues']);
        });
    });
});