Ejemplo n.º 1
0
} elseif ($uri == '/showpost' && $request->query->has('id')) {
    $postController = new PostController();
    $response = $postController->show_action($request->query->get('id'));
} elseif ($uri == '/showuser' && $request->query->has('id')) {
    $userController = new UserController();
    $response = $userController->show_action($request->query->get('id'));
} elseif ($uri == '/admin') {
    $postController = new PostController();
    $response = $postController->admin_action();
} elseif ($uri == '/adminuser') {
    $userController = new UserController();
    $response = $userController->admin_action();
} elseif ($uri == '/add') {
    $postController = new PostController();
    echo "hello";
    $response = $postController->add_action();
} elseif ($uri == '/adduser') {
    $userController = new UserController();
    echo "hello";
    $response = $userController->add_action();
} elseif ($uri == '/delete' && $request->query->has('id')) {
    $postController = new PostController();
    $response = $postController->delete_action($request->query->get('id'));
} elseif ($uri == '/deleteuser' && $request->query->has('id')) {
    $userController = new UserController();
    $response = $userController->delete_action($request->query->get('id'));
} elseif ($uri == '/about') {
    $postController = new PostController();
    $response = $postController->about_action();
} elseif ($uri == '/edit' && $request->query->has('id')) {
    $postController = new PostController();