tags:

views:

173

answers:

1

Hi all,

I'm trying to learn the MVC design pattern. Suppose I have a site with two layouts:

1) a home page: header1 - nav - content1 - footer

2) a subpage: header2 - nav - content2 - footer

My guess would be that I need two View classes for my two different layouts. But within these layouts there are repeating elements (the nav and the footer, in this example). What would be the most efficient way to implement this?

+1  A: 

If you want serious help then your going to need to post your code..

But i'm going to assume its a ~100 line homemade View parser and your using straight PHP as a "templating language"

In which case you can call an include directly from within the template

<?php include($TEMPLATE_DIR . 'sidebar.php'); ?>