Elgg\Http\ResponseFactory::prepareRedirectResponse PHP Method

prepareRedirectResponse() public method

Creates a redirect response
public prepareRedirectResponse ( string $url, integer $status = 302, array $headers = [] ) : RedirectResponse
$url string URL to redirect to
$status integer The status code (302 by default)
$headers array An array of response headers (Location is always set to the given URL)
return Symfony\Component\HttpFoundation\RedirectResponse
    public function prepareRedirectResponse($url, $status = 302, array $headers = array())
    {
        $header_bag = $this->getHeaders();
        $header_bag->add($headers);
        $response = new SymfonyRedirectResponse($url, $status, $header_bag->all());
        $response->prepare($this->request);
        return $response;
    }