You are here

public function IsMobileCacheContext::getContext in Mobile Detect 8.2

Returns the string representation of the cache context.

A cache context service's name is used as a token (placeholder) cache key, and is then replaced with the string returned by this method.

Return value

string The string representation of the cache context.

Overrides CacheContextInterface::getContext

File

src/Cache/Context/IsMobileCacheContext.php, line 40

Class

IsMobileCacheContext
Defines the 'Is mobile' cache context.

Namespace

Drupal\mobile_detect\Cache\Context

Code

public function getContext() {
  return (string) $this->mobileDetect
    ->isMobile();
}