At the end I found a solution for this. Print the output of a php file on an ajax call.
Mustache_Autoloader::register();
$m = new Mustache_Engine(array(
'loader' => new Mustache_Loader_FilesystemLoader('./templates/')
));
echo $m->render('templatename', $o);
and then using .html(data); with jQuery