function TrustedRedirectResponse::setTrustedTargetUrl

Same name in other branches
  1. 9 core/lib/Drupal/Core/Routing/TrustedRedirectResponse.php \Drupal\Core\Routing\TrustedRedirectResponse::setTrustedTargetUrl()
  2. 10 core/lib/Drupal/Core/Routing/TrustedRedirectResponse.php \Drupal\Core\Routing\TrustedRedirectResponse::setTrustedTargetUrl()
  3. 11.x core/lib/Drupal/Core/Routing/TrustedRedirectResponse.php \Drupal\Core\Routing\TrustedRedirectResponse::setTrustedTargetUrl()

Sets the target URL to a trusted URL.

Parameters

string $url: A trusted URL.

Return value

$this

File

core/lib/Drupal/Core/Routing/TrustedRedirectResponse.php, line 37

Class

TrustedRedirectResponse
Provides a redirect response which contains trusted URLs.

Namespace

Drupal\Core\Routing

Code

public function setTrustedTargetUrl($url) {
    $this->trustedUrls[$url] = TRUE;
    return $this->setTargetUrl($url);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.