I am trying to figure out a way to do this:
I want to have a core template file (structure.php):
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<?php include_once(NAKIDROOT."includes/head.php"); ?>
</head>
<body>
<div id="all">
<div id="page">
<?php include_once("includes/header.php"); ?>
<div id="main">
<div id="left">
<?php include_once("includes/left.php"); ?>
</div>
<div id="content">
<?php include_once("includes/messages.php"); ?>
<?php include_once("includes/page.php"); ?>
</div>
<?php include_once("includes/footer.php"); ?>
</div>
</div>
</div>
</body>
</html>
I would like the includes to have the ability to run header(Location) if needed so it seems like I would need to somehow have php read each of those include files.
Is there a way to render the include to check for headers and things first, and put its contents in a variable, so my structure file would instead be like this?:
<div id="page">
<?php echo($header); ?>
<div id="main">
<div id="left">
<?php echo($left); ?>
</div>
<div id="content">
<?php echo($messages); ?>
<?php echo($page); ?>
</div>
<?php echo($footer); ?>
</div>
</div>