Hallo,
Zit met het volgende probleem:
PHP
/*
* @return String output to the client
* Will output everything to the browser. Will include all files. Files will be as if they are part of this class. Will throw an Exception on error
*/
public function render() {
if (! ob_start ()) {
throw new Exception ( 'Could not load ob_start for the template system' );
}
try {
include_once (PATH . '/template/meta.php');
include_once (PATH . '/template/widget.php');
include_once (PATH . '/template/header.php');
include_once (PATH . '/template/content.php');
try {
if(!include_once (PATH . '/views/' . $this->filename . '.php')) { //Oops, view doesn't exist!
throw new Exception('View ' . $this->filename . ' does not exist');
}
}
catch (Exception $e) {
throw new Exception('Exception caught in the view at line <strong>' . $e->getLine() . '</strong> because of ' . $e->getMessage());
}
include_once (PATH . '/template/sidebar.php');
include_once (PATH . '/template/subfooter.php');
include_once (PATH . '/template/footer.php');
} catch ( Exception $e ) {
throw new Exception('Exception caught in the template system. Error message: '.$e->getMessage()); //Oops, something is wrong!
}
$rendered = ob_get_clean ();
// return utf8_encode ( $rendered );
}
Toon Meer
Zoals je ziet doe ik hier ob_start en vang alles later op met $rendered = ob_get_clean ();.
In de includes zit HTML met wat kleine php dingen tussendoor.
Echter worden deze includes meteeen uitegprint. Wat dus niet de bedoeling is en wat in mijn ogen niet lijkt horen te gebeuren doordat ik ob_start heb.
Heb klein tijdje niet aan de code gezeten door wat drukte. In de tussentijd wel paar kleine dingen aan de server verandard, mogelijk dat het daar aan kan liggen.
In php.ini is outputbuffer ingeschakeld.
Let niet op al die exceptions, dit ga ik nog aanpassen.
Wie ziet hier de fout of weet mogelijk wat de fout is in de code of de server?
Mvg,
Tim