Created
February 19, 2018 01:47
-
-
Save larowlan/1af01e63b600bcf6fa41816dba7e0975 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class SomeClass extends BlockBase { | |
/** | |
* {@inheritdoc} | |
*/ | |
public function getCacheContexts() { | |
$contexts = parent::getCacheContexts(); | |
// Tell Drupal that this block should be cached per-user. | |
$contexts[] = 'user'; | |
return $contexts; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment