/** * @param Request $request * @param Response $response */ public function __construct(Request $request, Response $response) { $this->cookies = $request->getCookies(); $this->response = $response; self::$instance = $this; }
/** * @param $url * @param int $code * @return \Symfony\Component\HttpFoundation\Response */ public function url($url, $code = 302) { substr($url, 0, 4) !== "http" ? $this->setTargetUrl($this->request->root() . '/' . ltrim($url, '/')) : $this->setTargetUrl($url); $this->setStatusCode($code); return $this->send(); }