When it comes to larger PHP sites you want (or should seriously think about wanting) to utilize a templating system of some sort, to strictly separate design from logic.

There are numerous templating systems out there.

All I know and worked with have at least two major disadvantages – in my opinion – the view of a backend PHP programmer:
For one they are expensive – they eat up a lot of server resources.
And then they come with this or another type of own language that is needed to get the content out.

To avoid server loads most of them introduce caching systems. Which is good and necessary and I could live with that. Since caching is (or should be) everywhere throughout a potentially high scaling and busy web application.

However, the second downside is harder to overcome.
Or isn’t it?

So, you’ve got your project lined out, have the frontend guys ready to start working (bear in mind, I’m talking as a backend programmer as well as a project lead) and the first thing to do – before you even get started, is to have these guys start learning the templating system you decided to use.

HALT.

Granted, one or the other might just have quite some experience in the system he needs to work with for your project, some others – on the other hand – might have used a different one, or never have used one at all.
First thing you need to do is to make sure, all the frontend guys are on the same page and level.

Now is the time to remember, that PHP can live embedded in HTML code.
In fact, even today, many rookies build their apps that way – mix HTML and PHP no matter what. However, that is, what I didn’t want to talk about (MVC etc.) so let’s move on.

Why I’ve been saying the above though is to remind you, that PHP is the ultimate template language by itself.
Why bother your people with learning another scripting language that will only have to be parsed, interpreted, whatever when there is PHP.
Chances are, that all of them at least have some knowledge in PHP.

Why would anyone use a construct like

<?php
    $arr = array( 1001,1002,1003);
    $smarty->assign('custId', $arr);
?>
{foreach from=$custId item=customer_id} id: {$customer_id}<br> {/foreach}

if you simply could do it the php way:

<?php
    $arr = array( 1001,1002,1003);
    foreach($arr as $customer_id) :
?>
id : <?=$customer_id;?><br />
<?php endforeach; ?>

This is why – many years ago – I came up with that super simple yet extremly powerfull (I think) PHP-templating system.
The cool thing about it is, that it only needs a very few lines to implement. It is plain PHP, slim, fast, easy to debug, all you’ll ever need.

So, how does it work?

Hell, it’s so simple I wouldn’t even dare thinking to copyright that!

All you need is a Page class (call it all you want) and a Template class. The Page class is what you will instatiate in your controller – be it a php file or a method in a ZF controller class or however you have your controllers designed.

Now all you need is to register your templates – that may be one or many for your HTML code to be served – and assign PHP variables that are being used in the template.

Usage:
Template

This is a Template file.

HTML with

Controller file

registerTemplate('tplName', PATHTOTEMPLATES . 'template.tpl');

//assign a value to the template
$what = 'PHP';
$tpl->set('what', $what);

//render the page
$html = $page->renderHtml();

//output HTML
echo $html;
exit();
?>