views_custom_cache_tag_demo.module in Views Custom Cache Tags 8
Contains views_custom_cache_tag.module.
File
modules/demo/views_custom_cache_tag_demo.moduleView source
<?php
/**
* @file
* Contains views_custom_cache_tag.module.
*/
use Drupal\Core\Cache\Cache;
use Drupal\node\NodeInterface;
/**
* Implements hook_node_presave().
*/
function views_custom_cache_tag_demo_node_presave(NodeInterface $node) {
$cache_tag = 'node:type:' . $node
->getType();
Cache::invalidateTags(array(
$cache_tag,
));
}
Functions
Name![]() |
Description |
---|---|
views_custom_cache_tag_demo_node_presave | Implements hook_node_presave(). |