brendanmetzger / diatom

A template framework
1 stars 0 forks source link

Templates Adjustments #72

Open brendanmetzger opened 3 years ago

brendanmetzger commented 3 years ago

should have access to configuration variables


<?template {"format": "m/d/y"?>
<div>
  <p>${replace}"</p>
</div>

Then somewhere in a controller perhaps, on could


$template = Template::open('example.html');

$elem = $template->render(['replace' => date($template->format)]);

It would be nicer if it were less dumb than that syntax, but noting now to stew over, as template-only configs appear to be popping up in document renders.

should be able to have track of some sort of index or self variable during loops


<!--iterate something index-->
<p>no ${$index}</p>

though this could also just be some magic variable, which I think self-referencing would also have to be. Though this is still super confusing and maybe a bad idea because it would have to be string able. I'm leaning no still, as before.


<!--iterate something -->
<p>no ${$__index} ${__self}</p>

Tables