[TYPO3-mvc] Include Javascript
Domi
djgarms at gmail.com
Mon Jun 11 13:09:09 CEST 2012
Hi
> So how do I include Javascript (or CSS) in from a extbase extension,
> preferably only in one single action?
Here a way for cached content for a JS file:
/**
* @var t3lib_PageRenderer
*/
protected $pageRenderer;
/**
* @param t3lib_PageRenderer $pageRenderer
*/
public function injectPageRenderer(t3lib_PageRenderer $pageRenderer) {
$this->pageRenderer = $pageRenderer;
}
$this->pageRenderer->addJsFile(
$file,
$this->arguments['type'],
$this->arguments['compress'],
$this->arguments['forceOnTop'],
$this->arguments['allWrap'],
$this->arguments['excludeFromConcatenation']
);
Check out the t3lib_PageRenderer functions, there youll find all other
methods for your needs.
Cheers Domi
More information about the TYPO3-project-typo3v4mvc
mailing list