Me agrada, simple y bien escrito.
Ejemplo:
Código PHP:
$data = array(
array(
'author' => 'Hernando de Soto',
'title' => 'The Mystery of Capitalism'
),
array(
'author' => 'Henry Hazlitt',
'title' => 'Economics in One Lesson'
),
array(
'author' => 'Milton Friedman',
'title' => 'Free to Choose'
)
);
$tpl = new Khaus_View_Template('books.phtml');
$tpl->view->books = $data;
echo $tpl->render();
books.phtml
Código PHP:
<?php if ($this->books) { ?>
<table>
<tr>
<th>Autor</th>
<th>Titulo</th>
</tr>
<?php foreach ($this->books as $key => $val) { ?>
<tr>
<td><?php echo htmlentities($val['author']) ?></td>
<td><?php echo htmlentities($val['title']) ?></td>
</tr>
<?php } ?>
</table>
<?php } else { ?>
<p>No hay libros que mostrar.</p>
<?php } ?>