예제 #1
0
파일: routing.php 프로젝트: JelenaKop/2KTVR
    $response = $postController->list_action();
} elseif ($uri == '/post') {
    $postController = new PostController();
    $response = $postController->list_action();
} elseif ($uri == '/user') {
    $userController = new UserController();
    $response = $userController->list_action();
} 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')) {