You are here

public function ParagraphsCollectionStyleConfigCacheTag::onSave in Paragraphs Collection 8

Invalidate the 'rendered' cache tag whenever the settings are modified.

Parameters

\Drupal\Core\Config\ConfigCrudEvent $event: The Event to process.

File

src/EventSubscriber/ParagraphsCollectionStyleConfigCacheTag.php, line 39

Class

ParagraphsCollectionStyleConfigCacheTag
Invalidates the 'rendered' cache tag when saving paragraphs_collection.settings.

Namespace

Drupal\paragraphs_collection\EventSubscriber

Code

public function onSave(ConfigCrudEvent $event) {
  if ($event
    ->getConfig()
    ->getName() === 'paragraphs_collection.settings') {

    // Invalidate caches.
    $this->cacheTagsInvalidator
      ->invalidateTags([
      'rendered',
    ]);
  }
}