[TYPO3-extbase-kickstarter] Suggestion for configuration change
Rens Admiraal
renst3 at rensnel.nl
Sat Sep 18 22:47:48 CEST 2010
Hi Nico,
I don't see a possibility to access the TCA array by javascript without
generating some javascript or using an AJAX call :-) I've now made a
'dynamic javascript' controller in which an array with configuration
objects is made, which is passed to the template using json_encode().
So, you mainly call this action with a js or json format, which outputs
the javascript configuration.
I now only use it for configuration arrays, not to completely initialize
the UI and stuff like that. I just set some variables in the
TYPO3.settings.kickstarter namespace, which are used later on. Another
advantage of this setup is the possibility to use localization, a
downside is the fact that we have to think about caching, and that the
object creation in PHP might become quite large in number of lines...
I'm not sure if the patch I send was ok, so the structure is as follows:
- There's a javascript include to a controller / action with format js
or json
- This action creates an array and assigns this json_encoded to the view
- In the view there's one or more variable declarations, like
TYPO3.settings.kickstarter.yui.extensionProperties = {var};
- These variables are used in the normal js as we know it now
By using only variable declarations in the 'dynamic js' we make the
variables variable, ain't it nice? :D
I hope the structure is clear :-)
Op 18-09-10 14:14, Nicolas de Haen schreef:
> Hi Rens,
>
> do you mean, it would require to add such javascript for being able to
> add a relation to existing TCA tables?
>
> If so, could you give an example how such a dynamic javascript
> configuration would look like?
>
> regards,
> Nico
>
More information about the TYPO3-project-extbase-kickstarter
mailing list