コード例 #1
0
ファイル: Action.php プロジェクト: redstarxz/flarumone
    /**
     * @param string $url
     * @return RedirectResponse
     */
    protected function redirectTo($url)
    {
        $url = Core::url() . $url;
        $content = sprintf('
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8" />
        <meta http-equiv="refresh" content="1;url=%1$s" />

        <title>Redirecting to %1$s</title>
    </head>
    <body>
        Redirecting to <a href="%1$s">%1$s</a>.
    </body>
</html>', htmlspecialchars($url, ENT_QUOTES, 'UTF-8'));
        $response = new RedirectResponse($url);
        $response->getBody()->write($content);
        return $response;
    }