I have this marked as PHP but only because I'll be using PHP code to show my problem.
So I have some code like this for the controller:
switch ($page)
{
case "home":
require "views/home.php";
break;
case "search":
require "views/search.php";
break;
}
Obviously there's more pages but this should illustrate my issue. There is a common header, navigation and footer for both of these pages (and for all pages on the site for that matter). Should I be using multiple require statements? My first guess would be:
switch ($page)
{
case "home":
require "templates/header.php";
require "templates/navigation.php";
require "views/home.php";
require "templates/footer.php";
break;
case "search":
require "templates/header.php";
require "templates/navigation.php";
require "views/search.php";
require "templates/footer.php";
break;
}
Some how my gut tells me this isn't correct ...