public function ParagraphsCollectionStyleConfigCacheTag::onSave

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

Parameters

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

File

paragraphs_collection/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',
    ]);
  }
}