teqneers / ext-application-bundle

A Symfony bundle to integrate Sencha Ext JS into a Symfony application
MIT License
4 stars 7 forks source link

Support multiple Ext JS applications within one Symfony backend #2

Open butimo opened 9 years ago

butimo commented 9 years ago

Assume i will run multiple Ext JS applications within a single Symfony backend, e.g. an admin application routed in /admin, it is currently not possible to configure multiple Ext JS applications.

mrmv commented 8 years ago

@sgehrig Thanks for this great bundle! Any plans on implementing this enhancement (running multiple Ext Js apps) ?

sgehrig commented 8 years ago

@mrmv Unfortunately not yet, sorry. Focus is currently on the Ext.direct bundle and library and we don't require multiple applications at the moment. So in fact, it's a "nice-to-have" from our point of view at the moment. If you like, I'd appreciate any help on that topic.

mrmv commented 8 years ago

@sgehrig I have looked into this and digging through the source code of the current bundle it is not an easy task. It seems to me we somehow need to make the actual path to the ext app (and it's builds) variable and right now this is hard coded in the config.yml. One thought I had was adding a parameter to the microloader in the twig template e.g.

<script id="microloader" data-app="{{ extjsApplicationId() }}" data-app-path="Administrator" type="text/javascript" src="{{ extjsBootstrapPath() }}?app-path=Administrator"></script>

In this case the base extjsBootstrapPath would be something like 'ext-apps' and in that folder would reside multiple ext apps (folders). The app-path request variable should help to get the the correct build manifest, and the content of that manifest would need some manipulating (before sending it back to the client) to be able to finally load the correct ext js/resources. After that we would still face some issues, but it might be a workable approach.

I hope this input helps and I would like to hear your questions/ideas and/or discuss this further.