function redirect($uri, $status = 302, array $headers = []) { $request = new \Lemmy\Request(); $url = $request->getBasePath() . ltrim($uri, '/'); $redirectResponse = new RedirectResponse($url, $status, $headers); return $redirectResponse; }
<?php require __DIR__ . '/../vendor/autoload.php'; $request = new \Lemmy\Request(); $router = new \Lemmy\Router(); $router->dispatch($request->method(), $request->get('url'));