W3cubDocs

/Drupal 8

function hook_views_invalidate_cache

hook_views_invalidate_cache()

Allow modules to respond to the invalidation of the Views cache.

This hook will fire whenever a view is enabled, disabled, created, updated, or deleted.

See also

views_invalidate_cache()

Related topics

Hooks
Define functions that alter the behavior of Drupal core.

File

core/modules/views/views.api.php, line 955
Describes hooks and plugins provided by the Views module.

Code

function hook_views_invalidate_cache() {
  \Drupal\Core\Cache\Cache::invalidateTags(array('views'));
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!modules!views!views.api.php/function/hook_views_invalidate_cache/8.1.x