PHP framework with theme support?
With my recent post regarding a project I have been working on, I have decided to open myself up to the idea of using an existing PHP Framework instead of designing my own, however I have a few issues with this that I'm hoping SO can help me out with.
- I really like MVC, it's a nice logical layout, however some of the frameworks that I have seen separate the MVC in really bad ways, i.e. having model, view, and controller folders and having modules in each, as opposed to having a module folder with MVC inside (I.e. user/model, user/views, user/controller).
- It seems as if not all frameworks have the ability to install or upgrade modules, i.e. run queries and whatnot.
- My biggest issue with all of the Frameworks I've seen thus far, is the lack of support for themes - I can understand not having them out of the box, but none of them seem to support them without rewrites. A theme in this case, is the ability to create custom views in a central folder (I.e. Themes/theme1/module1/view1.tpl.php)
Am I expecting too much from frameworks? Am I stuck writing my own? Or are there frameworks out there that do what I list above?
My main desire for a framework is that I have quite a few sites and I want to be able to write modules that I can share between them easily, and have just one codebase that I keep up to date. It'd be nice to be able to just write general purpose modules, upload to the sites that need them, and upload any changes blindly without any modifications. I know it sounds like I want a CMS, however every single CMS I have seen, has poor code, poor standards, is out dated, poorly designed, bloated, has features开发者_StackOverflow社区 I don't want, insecure, etc. (WP, Drupal, Joomla are the big ones I have issues with).
My suggestion:
Kohana
It's lightweight and emphasizes on good coding practices and standards. It uses MVC but also supports HMVC for even more flexible web apps.
Furthermore, each Module can be reused across applications without problems and all have their own MVC folder structure instead of putting modules in the controller/ or model/ folders. Installing modules is typically done with Git submodules, which works extremely well if you set things up properly. Updating modules through Git is very easy.
I'm not entirely sure what you want with the themes, but it shouldn't be a problem.
Some features that distinguish it from other frameworks:
- Lightweight, unobtrusive. It doesn't try to do too much
- Strictly lives by its coding standards
- Easily extended through modules
- Updated frequently and has a lively community
- Cascading Filesystem that lets you change any system file, without touching them directly
精彩评论