【发布时间】:2011-05-17 19:58:26
【问题描述】:
我有一个带有单个应用程序 frontend 的 symfony 1.4 项目。此应用程序具有单个模块 book 和单个操作 index。
我有 两个 用于索引操作的模板:indexSuccess.mobile.php 和 indexSuccess.html.php。该操作将设置格式以调用这些模板中的一个或另一个。
我想为这两个模板分别使用不同的布局:layout.mobile.php 和 layout.html.php。 apps/frontend/modules/book/config/view.yml 文件用于指定要使用的布局以及布局中包含哪些 CSS 和 JavaScript 文件。
由于每个模块只能有一个view.yml 文件,我如何配置view.yml 以便indexSuccess.mobile.php 使用layout.mobile.php 并加载适当的CSS 和JS 文件,而indexSuccess.html.php 使用layout.html.php 和加载其适当的 CSS 和 JS 文件?
我想使用布局,因为我最终会在这个模块中添加更多的动作/模板。
【问题讨论】: