Open alien315 opened 8 years ago
You should load your render function for only 1 time ( $renderFunc = require_once('the-compiled-template.php')
) then reuse it many times. ( echo $renderFunc($data1); echo $renderFunc($data2); ....
)
You should not include/require the compiled template many times , nor do LightnCandy::prepare($phpString)
on the same template many times.
Hi Had the same issue , removing the flag FLAG_BESTPERFORMANCE and adding the LightnCandy::FLAG_JSTRUE solved the issue by using the LightCandy runtime instead of dynamic functions . Hope this helps
If we want to render a single hbs tempalte multiple times in one page, the rendered php code fails because it tries to define multiple times the same function:
function lcr57eed8dde64efifvar($cx, $v, $zero) {
adding a function_exists check is more than enough:
if (!function_exists('lcr57eed8dde64efifvar')) {