[TYPO3-mvc] Include Javascript

Henjo Hoeksma me at henjohoeksma.nl
Mon Jun 11 22:23:15 CEST 2012


Hi Jost,

here's a gist on how you can use it:
https://gist.github.com/28645ad6b1ac2e484425

Kind regards,

Henjo

Problems are small because we learned how to deal with them.
Problems are big because we need to learn how to deal with them.


On Mon, Jun 11, 2012 at 1:09 PM, Domi <djgarms at gmail.com> wrote:

> 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
>
> ______________________________**_________________
> TYPO3-project-typo3v4mvc mailing list
> TYPO3-project-typo3v4mvc@**lists.typo3.org<TYPO3-project-typo3v4mvc at lists.typo3.org>
> http://lists.typo3.org/cgi-**bin/mailman/listinfo/typo3-**
> project-typo3v4mvc<http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc>
>


More information about the TYPO3-project-typo3v4mvc mailing list