Search code examples
phpsavant3

How do I get the output of Savant3 template into a string?


How do I get a Savant3 template to render to a string rather than just output it directly to the web page?


Solution

  • Use the fetch method rather than the usual display method.

    $my_template_output = $tpl->fetch('mytemplate.tpl.php');