mirror of
https://github.com/flextype/flextype.git
synced 2025-08-28 23:40:41 +02:00
@@ -17,9 +17,14 @@ use Flextype\Component\Arr\Arr;
|
||||
use Flextype\Component\I18n\I18n;
|
||||
use function Flextype\Component\I18n\__;
|
||||
|
||||
// Get URI
|
||||
$uri = explode('/', \Slim\Http\Uri::createFromEnvironment(new \Slim\Http\Environment($_SERVER))->getPath());
|
||||
|
||||
if (isset($uri) && isset($uri[0]) && $uri[0] == 'admin') {
|
||||
// Set base admin route
|
||||
$admin_route = 'admin';
|
||||
|
||||
// Run Admin for admin_route
|
||||
if (isset($uri) && isset($uri[0]) && $uri[0] == $admin_route) {
|
||||
|
||||
// Ensure vendor libraries exist
|
||||
!is_file($autoload = __DIR__ . '/vendor/autoload.php') and exit("Please run: <i>composer install</i>");
|
||||
|
@@ -2,22 +2,18 @@
|
||||
|
||||
namespace Flextype;
|
||||
|
||||
// Set base admin route
|
||||
$admin_route = '/admin';
|
||||
|
||||
// Site
|
||||
$app->get('/', '')->setName('admin.site.index');
|
||||
|
||||
|
||||
// UsersController
|
||||
$app->group($admin_route, function () use ($flextype, $app) {
|
||||
$app->group('/' . $admin_route, function () use ($flextype, $app) {
|
||||
$app->get('/registration', 'UsersController:registration')->setName('admin.users.registration');
|
||||
$app->post('/registration', 'UsersController:registrationProcess')->setName('admin.users.registrationProcess');
|
||||
$app->get('/login', 'UsersController:login')->setName('admin.users.login');
|
||||
$app->post('/login', 'UsersController:loginProcess')->setName('admin.users.loginProcess');
|
||||
});
|
||||
|
||||
$app->group($admin_route, function () use ($flextype, $app) {
|
||||
$app->group('/' . $admin_route, function () use ($flextype, $app) {
|
||||
|
||||
// UsersController
|
||||
$app->get('/profile', 'UsersController:profile')->setName('admin.users.profile');
|
||||
|
Reference in New Issue
Block a user