Beispiel #1
0
 /**
  * {@inheritdoc}
  */
 public function dispatch(\Jivoo\Http\ActionRequest $request, \Psr\Http\Message\ResponseInterface $response)
 {
     return \Jivoo\Http\Message\Response::redirect($this->getUrl());
 }
Beispiel #2
0
 /**
  * Create a path redirect.
  *
  * @param string|string[] $path Path array.
  * @param array $query Query.
  * @param string $fragment Fragment.
  * @param bool $permanent Whether redirect is permanent.
  * @param bool $rewrite Whether to force removal of script name from path.
  * @return ResponseInterface A redirect response.
  */
 public function redirectPath($path, array $query = [], $fragment = '', $permanent = false, $rewrite = false)
 {
     $location = new Message\Uri($this->request->pathToString($path, $rewrite));
     $location = $location->withQuery(http_build_query($query))->withFragment($fragment);
     return Message\Response::redirect($location, $permanent);
 }