Answer the question
In order to leave comments, you need to log in
How does a template engine work?
I only have this in my mind: 1. Load the template with
labels ( {
{
username}}, {% var1 == var2 %}, etc.) change it to <?=$username?>, etc.
3. Compile the template,
then when the template is called again, check if it is compiled, if not, then ^ again, if it is, load the finished one
Correctly ?
Answer the question
In order to leave comments, you need to log in
What template engine? What you described is a template engine from 2002. And it has nothing to do with twig
In general, yes, you can. Or immediately substitute the values of these variables.
But in most template engines, there are a lot of additional features besides this. Look at the description of twig, smarty, etc..
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question