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条)

报告相同问题?

悬赏问题

  • ¥15 抖音咸鱼付款链接转码支付宝
  • ¥15 ubuntu22.04上安装ursim-3.15.8.106339遇到的问题
  • ¥15 求螺旋焊缝的图像处理
  • ¥15 blast算法(相关搜索:数据库)
  • ¥15 请问有人会紧聚焦相关的matlab知识嘛?
  • ¥15 网络通信安全解决方案
  • ¥50 yalmip+Gurobi
  • ¥20 win10修改放大文本以及缩放与布局后蓝屏无法正常进入桌面
  • ¥15 itunes恢复数据最后一步发生错误
  • ¥15 关于#windows#的问题:2024年5月15日的win11更新后资源管理器没有地址栏了顶部的地址栏和文件搜索都消失了