Personally I always use smarty in php websites.. because it gives you the possibility, like in dot net to seperate code from markup.
I usually do something like this
class masterpage
{
protected $subpage;
public function output()
{
$smarty = new Smarty();
$smarty->assign('subpage', $this->subpage);
return $smarty->fetch('masterpage.tpl');
}
}
class helloworld extends masterpage
{
public function __construct()
{
this->subpage = 'helloworld.tpl';
}
}
class ciao extends masterpage
{
public function __construct()
{
this->subpage = 'ciao.tpl';
}
}
and as template files i have something like this
masterpage:
<html>
<body>
<div>This is the menu that has to be on every page!!!!</div>
{include file="$subpage"}
</body>
</html>
helloworld.tpl:
hey there: Hello world!
ciao.tpl:
hey there: ciao!
this way you can create classes that function as pages (asp.net webform) and one class masterpage that functions as a masterpage equivalent.