What engine templates are there for PHP?
3 answers
there is an "alternative" syntax for php which makes it more attractive among html tags, I can highly recommend it.
Short tags, while mostly discouraged and / or ridiculed, also have a nice advantage:
<?php echo $variable; ?>
can be:
<?= $variable; ?>
And you can do things like:
<ul>
<? foreach ( $myListItems as $id => $itemText ) : ?>
<li id="<?= $id; ?>">
<?= $itemText; ?>
</li>
<? endforeach; ?>
</ul>
What kind of minimum level template are you going to achieve with php, but it is still very readable and doesn't require you to mix in controller or model logic with your view.
+4
a source to share