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 adb push异常 adb: error: 1409-byte write failed: Invalid argument
  • ¥15 android报错 brut.common.BrutException: could not exec (exit code = 1)
  • ¥15 nginx反向代理获取ip,java获取真实ip
  • ¥15 eda:门禁系统设计
  • ¥50 如何使用js去调用vscode-js-debugger的方法去调试网页
  • ¥15 376.1电表主站通信协议下发指令全被否认问题
  • ¥15 物体双站RCS和其组成阵列后的双站RCS关系验证
  • ¥15 复杂网络,变滞后传递熵,FDA
  • ¥20 csv格式数据集预处理及模型选择
  • ¥15 部分网页页面无法显示!