class CacheableSecuredRedirectResponse
Same name in other branches
- 9 core/lib/Drupal/Core/Routing/CacheableSecuredRedirectResponse.php \Drupal\Core\Routing\CacheableSecuredRedirectResponse
- 8.9.x core/lib/Drupal/Core/Routing/CacheableSecuredRedirectResponse.php \Drupal\Core\Routing\CacheableSecuredRedirectResponse
- 11.x core/lib/Drupal/Core/Routing/CacheableSecuredRedirectResponse.php \Drupal\Core\Routing\CacheableSecuredRedirectResponse
Provides a common base class for cacheable safe redirects.
Hierarchy
- class \Drupal\Component\HttpFoundation\SecuredRedirectResponse extends \Symfony\Component\HttpFoundation\RedirectResponse
- class \Drupal\Core\Routing\CacheableSecuredRedirectResponse extends \Drupal\Component\HttpFoundation\SecuredRedirectResponse implements \Drupal\Core\Cache\CacheableResponseInterface uses \Drupal\Core\Cache\CacheableResponseTrait
Expanded class hierarchy of CacheableSecuredRedirectResponse
File
-
core/
lib/ Drupal/ Core/ Routing/ CacheableSecuredRedirectResponse.php, line 13
Namespace
Drupal\Core\RoutingView source
abstract class CacheableSecuredRedirectResponse extends SecuredRedirectResponse implements CacheableResponseInterface {
use CacheableResponseTrait;
/**
* {@inheritdoc}
*/
protected function fromResponse(RedirectResponse $response) {
parent::fromResponse($response);
$metadata = $this->getCacheableMetadata();
if ($response instanceof CacheableResponseInterface) {
$metadata->addCacheableDependency($response->getCacheableMetadata());
}
else {
$metadata->setCacheMaxAge(0);
}
}
}
Members
Title Sort descending | Modifiers | Object type | Summary | Overriden Title | Overrides |
---|---|---|---|---|---|
CacheableResponseTrait::$cacheabilityMetadata | protected | property | The cacheability metadata. | ||
CacheableResponseTrait::addCacheableDependency | public | function | |||
CacheableResponseTrait::getCacheableMetadata | public | function | |||
CacheableSecuredRedirectResponse::fromResponse | protected | function | Copies over the values from the given response. | Overrides SecuredRedirectResponse::fromResponse | |
SecuredRedirectResponse::createFromRedirectResponse | public static | function | Copies an existing redirect response into a safe one. | ||
SecuredRedirectResponse::isSafe | abstract protected | function | Returns whether the URL is considered as safe to redirect to. | 2 | |
SecuredRedirectResponse::setTargetUrl | public | function |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.