PDA

View Full Version : ob_start not working....



Icy Penguin
April 11th, 2008, 01:17 AM
Hi all,

I'm in the middle of creating my own templating system - but am having some troubles with ob_start().

This works fine (I don't see any output):



<? ob_start(); echo "Blargh!"; $content = ob_get_contents(); ob_end_flush(); ?>
This doesn't (output is still displayed):



<? ob_start(); include("layout.php"); $content = ob_get_contents(); ob_end_flush(); ?>
Where layout.php =



<? include "top.php"; ?>
<? include "header.php"; ?>
<? include "navigation.php"; ?>
<? include "content.php"; ?>
<? include "footer.php"; ?>
<? include "bottom.php"; ?>
Does output buffering not work for nested includes?

Icy Penguin
April 11th, 2008, 03:09 AM
Bah - found a die() at the end of my footer file which effectively canceled out ob_end_clean and echoing of the ob contents.

Stupidity strikes again.