Reputation: 1207
In My Controller extbase extension. 6.2 I'm using
$GLOBALS['TSFE']->additionalFooterData[$this->extKey] .= '<script src="//cdn.datatables.net/1.10.1/js/jquery.dataTables.min.js"></script>';
Is there any better method for replacing this.
I know the API like //==== Include Js File Formatting ========
$GLOBALS['TSFE']->getPageRenderer()->addJsFooterFile($jsFile, 'text/javascript', TRUE, FALSE, '', TRUE);
//==== Include css File Formatting =======
$GLOBALS['TSFE']->getPageRenderer()->addCssFile ( $cssFile, $rel = 'stylesheet', $media = 'all', $title = '', $compress = TRUE, $forceOnTop = FALSE, $allWrap = '', $excludeFromConcatenation = FALSE, $splitChar = '|' );
But in terms of adding a custom data they cant be used, any thing else. Any opinion?.
Upvotes: 1
Views: 3947
Reputation: 5840
There are three ways I'd consider:
Instead of using $GLOBALS['TSFE']
, let extbase inject the page renderer into your code and then do what you are doing now.
/**
* @var \TYPO3\CMS\Core\Page\PageRenderer
* @inject
*/
protected $pageRenderer;
(clear cache in the install tool after inserting this)
Upvotes: 4