Skip to content

Instantly share code, notes, and snippets.

@einpraegsam
Created August 29, 2017 09:37
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save einpraegsam/d8f567bdebd443bce1cea689f9ca602b to your computer and use it in GitHub Desktop.
Save einpraegsam/d8f567bdebd443bce1cea689f9ca602b to your computer and use it in GitHub Desktop.
Use TYPO3 cache tags in a plugin
<?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']);
}
}
# 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