Answer the question
In order to leave comments, you need to log in
How to escape (Template Engine)?
I'm starting to disassemble the template engine in order to write my own one for my needs ...
I ran into the problem of escaping <?php and ?> ..
base.html - template, contains( "{% echo 'lol'; %}").
I do this:
$temp = file_get_contents(...base.html);
echo str_replace(array('{%','%}'),array('<?php','?>'),$temp);
as a result I get a commit line:
Answer the question
In order to leave comments, you need to log in
here if it’s very rude .... you need to find what is inside {% %} to execute using eval and insert the result in place of {% %} . And I'm not sure that it will work with echo
why the heck template engine also your bike? php is a great templating engine! twig, haml, slim at the very worst
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question