I'm working on a template system and I'm running into problems using it.
<?php
require 'tpleng.php'; //require the template class
$tpl = new Template();
$tpl->set('title', 'someTitle');
echo $tpl->fetch('templates/index.tpl');
?>
This works fine so long as tpleng.php is located in the same directory as the script calling it. However, if I change the path to tpleng.php to includes/tpleng.php, the template file is not parsed. PHP successfully includes the file, but returns blank page. I have no idea why this is. See the good demo and the bad demo.
The code for the template engine is rather simple (40 lines of code or so). Scroll down a bit. I've stripped out the caching functionality as I won't be using it. The rest remains unchanged.
If someone could take a peek and offer some advice, I would be most appreciative.