I decided to rewrite my template engine , enter global codes , elseif .
What template I see in the future:
$SOME_CODE$ — обычный код. <if{$SOME_CODE$}>some code is true</if> — простое условие <if{$SOME_CODE$}> <if{$ALIAS_1$ == 123 && $QUERY$ == 'search'}> true <else> <if{$TRUE$}> true <else> false </if> </if> <elseif{$ALIAS_0$ == '/'}> index </if> — сложное условие
The question is, what do you think should be added to the functional?
The template engine that is specified in the post link has long been used on many of my projects, so it’s not necessary to say that I create a bicycle. I have less straight arms, a head, and I want to develop, get a new experience.
UPD: What is the best way to parse conditions and cycles? Regular expressions or string functions?