You are here

class SecureLoginCacheContext in Secure Login 8

Defines the SecureLoginCacheContext service for "per request URL" caching.

Cache context ID: 'securelogin'.

Hierarchy

Expanded class hierarchy of SecureLoginCacheContext

1 string reference to 'SecureLoginCacheContext'
securelogin.services.yml in ./securelogin.services.yml
securelogin.services.yml
1 service uses SecureLoginCacheContext
cache_context.securelogin in ./securelogin.services.yml
Drupal\securelogin\SecureLoginCacheContext

File

src/SecureLoginCacheContext.php, line 12

Namespace

Drupal\securelogin
View source
class SecureLoginCacheContext extends UrlCacheContext {

  /**
   * {@inheritdoc}
   */
  public static function getLabel() {
    return t('Secure login');
  }

  /**
   * {@inheritdoc}
   */
  public function getContext() {
    return $this->requestStack
      ->getMasterRequest()
      ->getUri();
  }

}

Members

Namesort descending Modifiers Type Description Overrides
RequestStackCacheContextBase::$requestStack protected property The request stack.
RequestStackCacheContextBase::__construct public function Constructs a new RequestStackCacheContextBase class.
SecureLoginCacheContext::getContext public function Returns the string representation of the cache context. Overrides UrlCacheContext::getContext
SecureLoginCacheContext::getLabel public static function Returns the label of the cache context. Overrides UrlCacheContext::getLabel
UrlCacheContext::getCacheableMetadata public function Gets the cacheability metadata for the context. Overrides CacheContextInterface::getCacheableMetadata