Neos\Flow\Mvc\Controller\AbstractController::redirect PHP Method

redirect() protected method

Redirect will be sent to the client which then performs another request to the new URI. NOTE: This method only supports web requests and will throw an exception if used with other request types.
See also: forward()
protected redirect ( string $actionName, string $controllerName = null, string $packageKey = null, array $arguments = null, integer $delay, integer $statusCode = 303, string $format = null ) : void
$actionName string Name of the action to forward to
$controllerName string Unqualified object name of the controller to forward to. If not specified, the current controller is used.
$packageKey string Key of the package containing the controller to forward to. If not specified, the current package is assumed.
$arguments array Array of arguments for the target action
$delay integer (optional) The delay in seconds. Default is no delay.
$statusCode integer (optional) The HTTP status code for the redirect. Default is "303 See Other"
$format string The format to use for the redirect URI
return void
    protected function redirect($actionName, $controllerName = null, $packageKey = null, array $arguments = null, $delay = 0, $statusCode = 303, $format = null)
    {
        if ($packageKey !== null && strpos($packageKey, '\\') !== false) {
            list($packageKey, $subpackageKey) = explode('\\', $packageKey, 2);
        } else {
            $subpackageKey = null;
        }
        $this->uriBuilder->reset();
        if ($format === null) {
            $this->uriBuilder->setFormat($this->request->getFormat());
        } else {
            $this->uriBuilder->setFormat($format);
        }
        $uri = $this->uriBuilder->setCreateAbsoluteUri(true)->uriFor($actionName, $arguments, $controllerName, $packageKey, $subpackageKey);
        $this->redirectToUri($uri, $delay, $statusCode);
    }