Re: 2.0: mustache template engine?
Reply #20 –
depends on where you want it integrated..
it could be injected in the TemplateLayers.class.php (haven't looked at how, tbh) or you could use the existing template functions and replace the code with a template loader:
function template_mail_queue()
{
global $mustache, $context, $txt:
$tpl_data = array(
'context' => $context,
'txt' => $txt,
);
$tpl = $mustache->loadTemplate('manage_mail'); // loads __DIR__.'/views/manage_mail.html';
echo $tpl->render($tpl_data); //renders the tpl_data array
template_show_list('mail_queue');
}
That would (in theory) allow us to create different themes with different engines. And funnily without touching the core files at all,
for example one Theme with pure PHP, HTML, CSS (what we currently use) ,..
another one with mustache as template engine ..
and a third one with twig..