<?php use EasyHQ\Router\Router; Router::get('/admin', 'Admin\\Home@index'); // ADMIN : USERS Router::get('/admin/users', 'Admin\\User@show'); Router::post('/admin/ajax_users', 'Admin\\User@get'); Router::post('/admin/ajax_users/:page', 'Admin\\User@getPage')->with('page', '[0-9]+'); Router::get('/admin/user/mail/:id', 'Admin\\User@resend')->with('id', '[0-9]+'); Router::post('/admin/ajax_user/:id', 'Admin\\User@ajaxShow')->with('id', '[0-9]+'); Router::post('/admin/user/:id', 'Admin\\User@update')->with('id', '[0-9]+'); // ADMIN : GROUPS Router::get('/admin/groups', 'Admin\\Group@show'); Router::post('/admin/group', 'Admin\\Group@insert'); Router::post('/admin/ajax_group', 'Admin\\Group@ajaxInsert'); Router::post('/admin/group/:id', 'Admin\\Group@update')->with('id', '[0-9]+'); Router::post('/admin/ajax_group/:id', 'Admin\\Group@ajaxShow')->with('id', '[0-9]+'); Router::get('/admin/group/default/:id-:csrf', 'Admin\\Group@defineDefault')->with('id', '[0-9]+')->with('csrf', '[a-z0-9]+'); Router::get('/admin/group/delete/:id-:csrf', 'Admin\\Group@delete')->with('id', '[0-9]+')->with('csrf', '[a-z0-9]+');
use EasyHQ\Router\Router; // BASE Router::get('/', 'Home@index'); Router::get('/error/404', 'Error@error404'); // USER CONNECTION Router::get('/login', 'User@signIn'); Router::get('/register', 'User@signUp'); Router::get('/logout', 'User@logout'); Router::get('/forget', 'User@forget'); Router::get('/verify/:key', 'Account@verify'); Router::post('/login', 'User@login'); Router::post('/register', 'User@register'); Router::post('/forget', 'User@newPassword'); // USER SEARCH Router::post('/users/ajax', 'Book@getNonMember'); Router::post('/users/ajax/:page', 'Book@getNonMemberByPage')->with('page', '[0-9]+'); // ACCOUNT Router::get('/account/:id-:name', 'Account@show')->with('id', '[0-9]+')->with('name', '[a-zA-Z0-9\\_\\.]+'); Router::get('/account/modif/:id-:name', 'Account@form')->with('id', '[0-9]+')->with('name', '[a-zA-Z0-9\\_\\.]+'); Router::post('/account/modif/:id-:name', 'Account@update')->with('id', '[0-9]+')->with('name', '[a-zA-Z0-9\\_\\.]+'); // ACCOUNT : FRIEND AND CLIENT Router::get('/account/book/:id-:name', 'Book@index')->with('id', '[0-9]+')->with('name', '[a-zA-Z0-9\\_\\.]+'); Router::get('/account/book/add/:id_from-:id_to-:csrf', 'Book@add')->with('id_from', '[0-9]+')->with('id_to', '[0-9]+')->with('csrf', '[a-z0-9]+'); Router::get('/account/book/ban/:id_from-:id_to-:csrf', 'Book@ban')->with('id_from', '[0-9]+')->with('id_to', '[0-9]+')->with('csrf', '[a-z0-9]+'); Router::get('/account/book/accept/:id_from-:id_to-:csrf', 'Book@accept')->with('id_from', '[0-9]+')->with('id_to', '[0-9]+')->with('csrf', '[a-z0-9]+'); Router::get('/account/book/delete/:id_from-:id_to-:csrf', 'Book@delete')->with('id_from', '[0-9]+')->with('id_to', '[0-9]+')->with('csrf', '[a-z0-9]+'); Router::post('/account/book/ajax', 'Book@get'); Router::post('/account/book/ajax/:page', 'Book@getPage')->with('page', '[0-9]+'); // ADMIN require __DIR__ . '/other_path/tasks.php'; require __DIR__ . '/other_path/admin.php';
<?php use EasyHQ\Router\Router; Router::get('/tasks', 'Task\\Home@index'); /* TASK : PROJECT */ Router::post('/tasks/project/ajax', 'Task\\Project@ajaxInsert'); Router::post('/tasks/project/ajax/:id', 'Task\\Project@ajaxUpdate')->with('id', '[0-9]+'); Router::post('/tasks/project/insert', 'Task\\Project@insert'); Router::post('/tasks/project/update/:id', 'Task\\Project@update')->with('id', '[0-9]+'); Router::get('/tasks/project/:id', 'Task\\Project@detail')->with('id', '[0-9]+'); Router::get('/tasks/project/delete/:id-:csrf', 'Task\\Project@delete')->with('id', '[0-9]+')->with('csrf', '[a-z0-9]+'); Router::get('/tasks/project/change/client/:idProject-:idFrom-:idTo-:csrf', 'Task\\Details@changeClient')->with('idProject', '[0-9]+')->with('idFrom', '[0-9]+')->with('idTo', '[0-9]+')->with('csrf', '[a-z0-9]+'); /* AJAX IN DETAILS */ Router::post('/tasks/details/ajax/:id', 'Task\\Details@get')->with('id', '[0-9]+'); Router::post('/tasks/details/ajax/:id-:page', 'Task\\Details@getPage')->with('id', '[0-9]+')->with('page', '[0-9]+');