My suggestion is XML/XSLT
This of course only if you are planning on php5 support and you may need to enable or compile xsl support.
It's been around for the better part of a decade. It provides tons of feauters and supports Xpath and Xquery to locate and compare nodes and data. It also allows for conditions, looping, and don't forget it allows and unlimited number of subtemplate inclusion.
If you set it up so your php code writes pure XML output and then you load that into the DOM as well as loading the XSL template file and do the transformation with php you will end up with html code.
XSL provides very good logic/presentation seperation. Its very intelligent to look at and figure out whats being done and it validates. I have also seen Dreamweaver CS3 do live transformations so a designer could connect xml and make what they are looking at true to life.
Take a look at http://us2.php.net/manual/en/ref.xsl.php for more info. -and/or- http://www.w3schools.com/xsl/ for xsl language constructs.
It LOOKS like it is overwhelming but it is very simple and easy to adapt. It doesn't rewrite the php langauge and it is very fast. I have been using it for the past 6 months to develop a custom enterprise CMS system. If you PM me I will be glad to show you some examples from my current sandbox site which uses xml/xslt to build dynamic forms, pages, etc.
Mike