【发布时间】:2012-05-18 13:46:19
【问题描述】:
如何在php 中制作母版页?就像 ASP.NET MVC 中的 Layout.cshtml(和 RenderBody())?
谢谢!
附:也许有第三方工具可以达到这个目的?
编辑
好的。问题与 MVC 架构无关!请看这里:http://jsfiddle.net/challenger/8qn22/109/
I want the master page/layout to stay when user gets redirected to the other page-
Want an average page to be nested inside the content division。So if it is a form I want this form to be displayed like:http://jsfiddle.net/challenger/XgFGb/17/
【问题讨论】:
-
您在 PHP 中使用任何框架吗? PHP 没有开箱即用的 MVC,因此您需要选择一个 MVC 框架,并且大多数时候它们都有自己的“布局/模板”引擎。看看 Code Igniter、Kohana、Sympfony 等。
-
我根本不考虑 MVC 模式。所需要的只是母版页的概念。
-
好吧,你将它与作为 MVC 的 ASP.NET 进行了比较,所以我发现你需要某种 mvc 引擎......
-
如果你想使用模板,无论如何你都需要 MVC。试用 PHP 无脂肪框架。它很轻。 bcosca.github.com/fatfree
标签: php master-pages