[TYPO3-mvc] Instantiate extbase action controller inside tslib_fe hook

Thomas "Thasmo" Deinhamer thasmo at gmail.com
Sun Nov 1 23:45:08 CET 2009


I started to code on a script, which will compress and concatenate
JS and CSS files into one file given the two hooks inside the
new t3lib PageRenderer.

Investigating the problem with headerData I'm wondering if it may
be smart to implement another hook, just for the purpose of
detecting JS and CSS inside the headerData and moving it into
the JS and CSS arrays available inside the renderer class.
(Or even implement it inside the renderer.)

Because otherwise it would be neccessary to call a function
like 'convertHeaderData()' inside both available hooks for now.

The JS compressing and concatenating is done - the basic - CSS
is my next step, which is a bit more complicated, as the different
media types need to be taken care of. (Still there is the need of
a correct implementation of concatenating/compressing to the
right places like <head> or above </body>, seperatly.)

For the JS compression I'm using the JSMinPlus Class used inside
the minify project on code.google.com.

Oppinions are welcome!

Thanks!


Steffen Kamper schrieb:
> Hi,
> 
> Thomas "Thasmo" Deinhamer schrieb:
>> What is the correct way to add external CSS and JS files
>> inside a hook and/or a frontend plugin/action controller?
>>
>> If files are added using 'additionalHeaderData()', the files
>> won't be available inside the frontend renderer arrays.
>>
>> What's the solution?
>>
>> Thank you!
>>
> 
> the arrays are references. Add files in array or unset elements.
> As this is a transition many users used headerData for JS/CSS what 
> should not be used in future for that. You have a reference of the 
> pageRenderer in Hook, so you can access this data with $pObj->headerData.
> 
> vg Steffen


More information about the TYPO3-project-typo3v4mvc mailing list