statusCode(404)->view('404')->render(); die(); } $route = $routes[$request_method.':'.$uri]; // Duar (actually, split the method string to class name and method name) $method_part = explode("@",$route['controller']); // Get class name and method name $class = $method_part[0]; $method = $method_part[1]; // Get fully qualified class name of route $fqcn = 'Application\\Controllers\\'.$class; $controller = new $fqcn(); $response = $controller->$method($request,$response); $response->render(); // Convert array to JSON