Skip to content

Instantly share code, notes, and snippets.

@init90
Created September 1, 2016 15:00
Show Gist options
  • Save init90/0c9b6a5aa98b8c392e2447d3d5c793ad to your computer and use it in GitHub Desktop.
Save init90/0c9b6a5aa98b8c392e2447d3d5c793ad to your computer and use it in GitHub Desktop.
Drupal 8, get cache tags.
// from entity
$tags = \Drupal::entityTypeManager()->getStorage('job')->load(1)->getCacheTags();
// from views
$tags = \Drupal\views\Entity\View::load('front')->getCacheTags();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment