PHP code example of wazum / typo3-live-reload
1. Go to this page and download the library: Download wazum/typo3-live-reload library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
wazum / typo3-live-reload example snippets
> $GLOBALS['TYPO3_CONF_VARS']['SYS']['features']['frontend.cache.autoTagging'] = true;
>
use TYPO3\CMS\Core\Attribute\AsEventListener;
use Wazum\LiveReload\Event\ModifyBroadcastTagsEvent;
#[AsEventListener(identifier: 'news/broadcast-tags')]
final class NewsBroadcastTagsListener
{
public function __invoke(ModifyBroadcastTagsEvent $event): void
{
if ($event->getTable() !== 'tx_news_domain_model_news') {
return;
}
$event->addTags('tx_news_uid_' . $event->getUid(), 'tx_news_pid_' . $event->getUidPage());
}
}