doumaoao0182 2012-10-10 17:56
浏览 31
已采纳

使用zf2的模板系统?

we are planing to create a CMS with zf2 and doctrine orm .

actually we are concern about our cms templating we want our system works with several templates and easily change between themes via admin

and creating a new templates should be easy for end-users developers

we want an advice or suggest for how to build templating system that :

there is a core module and there a lot sub modules with their own phtml so where to store theme1 phtml and where to store theme2 phtmls ...

any suggest or advice please thanks

  • 写回答

3条回答 默认 最新

  • dongranding3909 2012-10-10 21:47
    关注

    if you activate another module in the application.config.php which has the same views and layouts (same folder structure and filenames) it's viewscripts and layouts will automatically be used when it's loaded after your core module.

    so you could simply make your application.config.php dynamic to load the active template module which only contains the view folder. this would be a simple and effective solution without any other libraries.

    additionally you can use an asset manager like assetic to also provide images, css etc. inside of your (template-)modules. (have a look at zf2-assetic-module, I wrote my own assetize-module based on assetic to fit my needs...)

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥20 机器学习能否像多层线性模型一样处理嵌套数据
  • ¥20 西门子S7-Graph,S7-300,梯形图
  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效