Same name and namespace in other branches
- 8.9.x core/lib/Drupal/Core/Routing/CacheableSecuredRedirectResponse.php \Drupal\Core\Routing\CacheableSecuredRedirectResponse
- 9 core/lib/Drupal/Core/Routing/CacheableSecuredRedirectResponse.php \Drupal\Core\Routing\CacheableSecuredRedirectResponse
Provides a common base class for cacheable safe redirects.
Hierarchy
- class \Drupal\Core\Routing\CacheableSecuredRedirectResponse extends \Drupal\Component\HttpFoundation\SecuredRedirectResponse implements CacheableResponseInterface uses 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
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CacheableResponseTrait:: |
protected | property | The cacheability metadata. | |
CacheableResponseTrait:: |
public | function | ||
CacheableResponseTrait:: |
public | function | ||
CacheableSecuredRedirectResponse:: |
protected | function |