Scalr\Api\Rest\ApiApplication::redirectTo PHP Метод

redirectTo() публичный Метод

Redirects to the specified named route
public redirectTo ( string $route, array $params = [], number $status = 302 )
$route string The name of the Route
$params array optional The list of the parameters
$status number optional The HTTP response status code.
    public function redirectTo($route, $params = array(), $status = 302)
    {
        throw new \DomainException("Redirect feature will not work in the API because new URL requires a new X-Scalr-Signature header.");
        if (isset($this->settings[static::SETTING_API_VERSION])) {
            $params['apiversion'] = $this->settings[static::SETTING_API_VERSION];
        }
        if (isset($this->settings[static::SETTING_SCALR_ENVIRONMENT])) {
            $params['environment'] = $this->settings[static::SETTING_SCALR_ENVIRONMENT];
        }
        $url = $this->getRouteUrl($route, $params);
        $this->redirect($url, $status);
    }