PHP框架有主题支持吗?
我的最近的帖子关于在我一直在从事的项目中,我决定开放自己的想法,使用现有的 PHP 框架而不是设计自己的框架,但是我对此有一些问题,我希望 SO 可以帮助我解决。
- 我真的很喜欢 MVC,它是一个很好的逻辑布局,但是我见过的一些框架以非常糟糕的方式分离 MVC,即具有模型、视图和控制器文件夹,并且每个文件夹中都有模块,而不是有一个模块文件夹内部有 MVC(即用户/模型、用户/视图、用户/控制器)。
- 似乎并非所有框架都能够安装或升级模块,即运行查询等。
- 到目前为止,我见过的所有框架的最大问题是缺乏对主题的支持 - 我可以理解没有开箱即用的主题,但似乎没有一个框架不支持它们而无需重写。在这种情况下,主题是能够在中央文件夹中创建自定义视图(即 Themes/theme1/module1/view1.tpl.php),
我对框架的期望是否过高?我是不是被困在自己写了?或者是否有框架可以实现我上面列出的功能?
我对框架的主要愿望是我有相当多的网站,我希望能够编写可以在它们之间轻松共享的模块,并且只有一个我保持最新的代码库。如果能够只编写通用模块,上传到需要它们的站点,并在不进行任何修改的情况下盲目上传任何更改,那就太好了。我知道这听起来像是我想要一个 CMS,但是我见过的每一个 CMS 都有糟糕的代码、糟糕的标准、过时的、设计糟糕的、臃肿的、有我不想要的功能、不安全等等。(WP、Drupal 、Joomla 是我遇到的最大问题)。
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 I don't want, insecure, etc. (WP, Drupal, Joomla are the big ones I have issues with).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我的建议:
Kohana
它是轻量级的,强调良好的编码实践和标准。它使用 MVC,但也支持 HMVC,以实现更灵活的 Web 应用程序。
此外,每个模块都可以在应用程序之间重用,没有任何问题,并且都有自己的 MVC 文件夹结构,而不是将模块放在控制器/或模型/文件夹中。安装模块通常是使用 Git 子模块完成的,如果设置正确的话,它会非常有效。通过 Git 更新模块非常简单。
我不完全确定你想要什么主题,但这应该不是问题。
它与其他框架的一些区别特征:
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: