Newer
Older
flow-task / server / App / routes_map.php
<?php

namespace App;

use \App\Controller\AuthController;
use \App\Controller\GroupsController;

function init_auth($router) {
	$router -> linking("GET", "signup", function(){
		$auth_controller = new AuthController();
		return $auth_controller -> signup();
	});


	$router -> linking("GET", "signin", function(){
		$auth_controller = new AuthController();
		return $auth_controller -> signin();
	});

	$router -> linking("GET", "signout", function(){
		$auth_controller = new AuthController();
		return $auth_controller -> signout();
	});
}

function init_groups($router) {
	$router -> linking("GET", "groups-create", function(){
		$groups_controller = new GroupsController();
		return $groups_controller -> create();
	});

	$router -> linking("GET", "groups-list", function(){
		$groups_controller = new GroupsController();
		return $groups_controller -> get_list();
	});

	$router -> linking("GET", "groups-change-title", function(){
		$groups_controller = new GroupsController();
		return $groups_controller -> change_title();
	});

	$router -> linking("GET", "groups-change-position", function(){
		$groups_controller = new GroupsController();
		return $groups_controller -> change_position();
	});

	$router -> linking("GET", "groups-remove", function(){
		$groups_controller = new GroupsController();
		return $groups_controller -> remove();
	});
}

function init_routes_map($router) {
	init_auth($router);
	init_groups($router);
}