Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. IsFrontPathCacheContext.php

function IsFrontPathCacheContext::getCacheableMetadata

Overrides CacheContextInterface::getCacheableMetadata

File

core/lib/Drupal/Core/Cache/Context/IsFrontPathCacheContext.php, line 47

Class

IsFrontPathCacheContext
Defines a cache context for whether the URL is the front page of the site.

Namespace

Drupal\Core\Cache\Context

Code

public function getCacheableMetadata() {
    $metadata = new CacheableMetadata();
    $metadata->addCacheTags([
        'config:system.site',
    ]);
    return $metadata;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal