Ejemplo n.º 1
0
    $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();
    $response = $postController->edit_action($request->query->get('id'));
} elseif ($uri == '/edituser' && $request->query->has('id')) {
    $userController = new UserController();
    $response = $userController->edit_action($request->query->get('id'));
} elseif ($uri == '/update') {
    $postController = new PostController();
    $response = $postController->update_action($request->query->get('id'));