get('/', [MainController::class, 'actionIndex']); $router->get('/example', [MainController::class, 'actionExample']); //$router->get('/createUser', [Users::class, 'actionCreateUser']); $router->get('/allUsers', [Users::class, 'actionViewAllUsers']); $router->get('/User', [Users::class, 'actionViewUser'], ['3']); $router->get('/allQuestions', [Questions::class, 'actionViewAllQuestions']); $router->get('/allPosts', [Posts::class, 'actionViewAllPosts']); $router->get('/allAnswers', [Answers::class, 'actionViewAllAnswers']); $dispatcher = new Phroute\Phroute\Dispatcher($router->getData()); $response = $dispatcher->dispatch($_SERVER['REQUEST_METHOD'], parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)); // Print out the value returned from the dispatched function echo $response;