Wrapper function to render a template file, support phptemplate & twig