<?php
function e($s)
{
return htmlspecialchars($s, ENT_QUOTES, 'UTF-8');
}
/**
*
* @param string $tplFile Template file
* @param array $vars Values constituting the template's content
* @param array $context Values from calling code that can be modified in the
* template
* @return string Rendered output
*/
function renderTpl($tplFile, array $vars = array(), array &$context = array())
{
ob_start();
require $tplFile;
return ob_get_clean();
}
$context = array(
'title' => 'Standardtitel'
);
$content = renderTpl(
__DIR__ . '/template.phtml',
array(
'name' => 'Lucas Barrios'
),
$context
);
?><!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title><?=e($context['title'])?></title>
</head>
<body>
<?=$content?>
</body>
</html>