On version with LightCandy library, rendering is done on default PHP way, by creating PHP file, include it and call as a function.
// Save the compiled PHP code into a php file
file_put_contents('render.php', '<?php ' . $php . '?>');
// Get the render function from the php file
$renderer = include('render.php');
$results = $renderer($data, ['debug' => Runtime::DEBUG_ERROR_LOG]);
Problem:
On version with LightCandy library, rendering is done on default PHP way, by creating PHP file, include it and call as a function.
Current solution:
Proposal:
Something like this: https://github.com/jenschude/HandlebarsBundle/blob/develop/src/HandlebarsEnvironment.php