<?php namespace Hyper\Application\Routes; require_once 'Core/Router.php'; use Hyper\Core\Router; $router = new Router(); $router->addRoute('get', '/login', 'UserController@login'); $router->addRoute('get', '/logout', 'UserController@logout'); $router->addRoute('post', '/login', 'UserController@login'); $router->addRoute('get', '/register', 'UserController@register'); $router->addRoute('post', '/register', 'UserController@register'); $router->addRoute('get', '/profile', 'UserController@profile'); $router->addRoute('post', '/profile', 'UserController@profile'); $router->addRoute('get', '/products', 'Products\\CategoriesController@index'); $router->addRoute('get', '/products/categories', 'Products\\CategoriesController@index'); $router->addRoute('get', '/products/category/{id}', 'Products\\ProductsController@listAll'); $router->addRoute('get', '/products/product/{id}', 'Products\\ProductsController@getProduct'); $router->addRoute('post', '/categories/add', 'Products\\CategoriesController@add'); $router->addRoute('post', '/category/{id}', 'Products\\CategoriesController@edit'); $router->addRoute('get', '/category/delete/{id}', 'Products\\CategoriesController@delete'); $router->addRoute('post', '/product/add', 'Products\\ProductsController@add'); $router->addRoute('post', '/product/{id}', 'Products\\ProductsController@edit'); $router->addRoute('get', '/product/delete/{id}', 'Products\\ProductsController@delete'); $router->addRoute('post', '/products/sort', 'Products\\ProductsController@sort'); $router->addRoute('post', '/review/{product_id}', 'Products\\ReviewsController@update'); $router->addArea(array('name' => 'editor', 'prefix' => '/editor'), array(array('get', '/', 'UsersController@index'), array('get', '/users', 'UsersController@index'), array('get', '/ban', 'BanController@index'), array('get', '/ban/delete/{id}', 'BanController@destroy'), array('post', '/ban/add', 'BanController@create'), array('get', '/users', 'UsersController@index'), array('get', '/user/delete/{id}', 'UsersController@destroy'), array('post', '/users/add', 'UsersController@create')));
<?php namespace Hyper\Application\Routes; require_once 'Core/Router.php'; use Hyper\Core\Router; $router = new Router(); $router->addRoute('get', '/login', 'UserController@login'); $router->addRoute('get', '/logout', 'UserController@logout'); $router->addRoute('post', '/login', 'UserController@login'); $router->addRoute('get', '/register', 'UserController@register'); $router->addRoute('post', '/register', 'UserController@register'); $router->addRoute('get', '/profile', 'UserController@profile'); $router->addRoute('post', '/profile', 'UserController@profile'); $router->addArea(array('name' => 'editor', 'prefix' => '/editor'), array(array('get', '/login', 'EditorController@login'), array('post', '/login', 'EditorController@login'), array('get', '/profile', 'EditorController@profile'), array('post', '/profile', 'EditorController@profile'), array('get', '/categories/add', 'CategoryController@addCategory'), array('post', '/categories/add', 'CategoryController@addCategory')));