I'm probably not going to have time to study your code closely at the moment (sorry, busy month), but I have built my own theme-management module for the VuFind project. You can find it here:
https://github.com/vufind-org/vufind/tree/master/module/VuFindTheme Feel free to take a look and borrow ideas if you see anything you like. I've gone the route of completely separating the themes from the modules (there's a separate themes directory, and themes can inherit from one another), and I expose assets from within the themes directories using some Apache rewrite magic (see the top of https://github.com/vufind-org/vufind/blob/master/config/vufind/httpd-vufind.conf). I'm happy to discuss particular issues if you have questions. - Demian > -----Original Message----- > From: Juan Pedro Gonzalez [mailto:[email protected]] > Sent: Wednesday, September 04, 2013 7:11 PM > To: [email protected] > Subject: [fw-general] ThemeManager > > Hi, > I'm not sure if this fits here... I'm quite new to Zend Framework 2, but > looking through the code of the framework itself and some other > modules/libraries I've started the development of a ThemeManager library. The > library is located at: > https://github.com/shadowfax/zf-themes > I would be very pleased if someone could take a look at it and send me > comments on bad practices I've made or bad code (I guess there should be some > of those), if someone would contribute that would make me even happier (but > not asking so much). > My main goals are: > Maintain ZF2 views structureEasy to integrateAssets per module and theme. > I've found out some classes are difficult to extend. I've created a new > Mvc/Application just for the init method so it loads my theme service and a > bootstrap listener. If I could hook a global onBootstrap event I guess this > could be neater however initializing the new class makes some sense as it is a > theme application. > I've created a new feature for the modules which tells the ThemeManager that > modules supports and makes use of themes. This way I add the view path from > code. Basically instead of using the 'view' directory I use > 'themes/theme_name' directory to hold the views in the same way the original > directory did.... If no matching theme exists for a given module it uses the > 'Default' theme. > Assets are located inside 'themes/theme_name/assets/'. The service creates a > route named 'assets' (To be exact the one that is interesting is > '/assets/module/wildcard'. This route is only used for matching and gives us > one parameter which is the module name and a wildcard which is the path to the > asset relative to the assets directory for the module. This way each theme may > contain it's own assets. > Right now I've created one adapter which will use the directory structure and > a json file that gives information about the theme. I'm planning on adding > some new adapter for Database driven theme information (ZF2 database and > Doctrine). > Thanks you for reading untill the end. > -- List: [email protected] Info: http://framework.zend.com/archives Unsubscribe: [email protected]
