Created
August 29, 2017 09:37
-
-
Save einpraegsam/d8f567bdebd443bce1cea689f9ca602b to your computer and use it in GitHub Desktop.
Use TYPO3 cache tags in a plugin
This file contains 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 | |
namespace In2code\Contacts\Controller; | |
use TYPO3\CMS\Extbase\Mvc\Controller\ActionController; | |
/** | |
* Class ContactController | |
*/ | |
class ContactController extends ActionController | |
{ | |
/** | |
* @return void | |
*/ | |
public function contactAction() | |
{ | |
$this->view->assign('contact', ['uid' => 123]); | |
$GLOBALS['TSFE']->addCacheTags(['contact']); | |
} | |
} |
This file contains 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
# clear all pages with plugin contact if there is a change in PID 2529 or in children pages | |
[PIDinRootline = 2529] | |
TCEMAIN.clearCacheCmd = cacheTag:contact | |
[end] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment