abstract class CacheableSecuredRedirectResponse in Drupal 8
Same name and namespace in other branches
- 9 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 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 |
Copies over the values from the given response. Overrides SecuredRedirectResponse:: |
|
SecuredRedirectResponse:: |
public static | function | Copies an existing redirect response into a safe one. | |
SecuredRedirectResponse:: |
abstract protected | function | Returns whether the URL is considered as safe to redirect to. | 2 |
SecuredRedirectResponse:: |
public | function | Sets the redirect target of this response. |