Search code examples
phpmaster-pages

Implementing master pages functionality. PHP


How to make master pages in php? Like a Layout.cshtml (and RenderBody()) in ASP.NET MVC?

Thanks!

P.S. Maybe there's a third-party tool for the purpose?

EDIT

Ok. The thing is not about MVC architecture! Do look here: http://jsfiddle.net/challenger/8qn22/109/

  1. I want the master page/layout to stay when user gets redirected to the other page
  2. 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/

Solution

  • Ok. The solution that suits me the best is described here http://www.phpro.org/tutorials/Introduction-to-PHP-templating.html#9. It is easy, fast to imlement and doesn't enforce you to use a templating engine. Cool!