Well, the answer was gone, and that was not my script. Before any HTML tag, I load all the content, if custom headers are defined, I only show the content (extracted from the templates)
<?php
if(empty($page->customHeader)): ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title><?php print $page->title ?></title>
</head>
<body>
<div class="container">
<div class="header">
</div>
<div class="content">
<?php print $page->content ?>
</div>
<div class="footer">
</div>
</div>
</body>
</html>
<?php else:
print $page->content;
endif; ?>
ob_get_contents(), / . - ob_get_contents() , , .
.
...
</html>
<?php else:
foreach($page->customHeader as $header) {
header($header, true);
}
readfile($page->headerContent);
endif; ?>
:
ob_get_contents() .
, , !