src/Router.php
public function redirectPath($path, array $query = [], $fragment = '', $permanent = false, $rewrite = false)
    {
        $location = new Message\Uri($this->request->pathToString($path, $rewrite));
        $location = $location->withQuery($this->buildQuery($query))
            ->withFragment($fragment);
        return Message\Response::redirect($location, $permanent);
    }
public function redirectPath($path, array $query = [], $fragment = '', $permanent = false, $rewrite = false)
    {
        $location = new Message\Uri($this->request->pathToString($path, $rewrite));
        $location = $location->withQuery($this->buildQuery($query))
            ->withFragment($fragment);
        return Message\Response::redirect($location, $permanent);
    }
public function redirectPath ( $ path , array $ query = [ ] , $ fragment = '' , $ permanent = false , $ rewrite = false ) { $ location = new Message \ Uri ( $ this -> request -> pathToString ( $ path , $ rewrite ) ) ; $ location = $ location -> withQuery ( $ this -> buildQuery ( $ query ) ) -> withFragment ( $ fragment ) ; return Message \ Response :: redirect ( $ location , $ permanent ) ; }
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.
Create a path redirect .