Skip to content
Ore Landau edited this page May 27, 2013 · 10 revisions

#SxRequireJs

SxRequireJs explained

SxRequireJs's goal is to offer the flexibility and structure of both ZF2 and RequireJS. My initial thought of using RequireJS in combination with ZF2 was that it would be a bit messy if all modules had to supply their application entry point and assets to the main application. This would involve too much work, and would take the module out of.. well, module.

To me, this is a problem. Or better yet, a "challenge". I fixed this by setting up one entry point for every module. This entry point takes away a lot of headaches, and also supplies a bit of structure. The idea behind this module was to supply multiple applications for multiple ZF2 modules, without having dependencies across them. These dependencies will still work, as all paths will be registered in the main application. To top all of this off, we run every module's main application individually so that they all run as their own module.

This gives you flexibility, structure and a modular structure. Just the way we like it.

If you'd like to better understand what SxRequireJs's understanding of an application is, you can check out the applications page which tries to explain what it is, what it does and why it does it.

Clone this wiki locally