[TYPO3-mvc] How to add css and js files in a backend module
Stefan Kruse
besucher80 at gmx.de
Fri Apr 19 07:44:08 CEST 2013
Hm, okay. Again.
Hi, i try to add some css and js files to a backend module.
I wrote me a little viewhelper:
public function render($path, $compress = FALSE) {
$doc = t3lib_div::makeInstance('template');
$pageRenderer = $doc->getPageRenderer();
// JS
if (strtolower(substr($path, -3)) === '.js')
{
$pageRenderer->addJsFile($path, NULL, $compress);
// CSS
} elseif (strtolower(substr($path, -4)) ===
'.css') {
$pageRenderer->addCssFile($path, 'stylesheet', 'all', '', $compress);
}
}
But it doesnt work. How ist he best way to add css and js files to a backend
module in typo3?
I try vhs , fed and whatelse, but nothing works.
Maybe somebody a tipp? Thanks
More information about the TYPO3-project-typo3v4mvc
mailing list