Template¶
A template is a preset document, filled with values in placeholders, to display the resulting data. This is also called a view.
PHP used to be known as a template engine. Nowadays, template engines are written in PHP.
Templates may be produced in any file format : HTML, CSS, Javascript, JSON, PDF, URL, etc.
Template may be large : they are then broken down into smaller and reusable sub-templates.
Some template packages : Twig, Latte, Blade, smarty.
<?php
// piece
echo "<h1>".$name."</h1>";
?>
Related : View In Presentation
Related packages : twig/twig, smarty/smarty, latte/latte, twig/twig