0

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 Answer 1

1

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'); ?>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.