Skip to content

Instantly share code, notes, and snippets.

@Elijen
Created February 1, 2014 11:52
Show Gist options
  • Save Elijen/8751280 to your computer and use it in GitHub Desktop.
Save Elijen/8751280 to your computer and use it in GitHub Desktop.
public function renderTemplate($templatePath /* $data = array(), $echo = false */) {
ob_start();
extract((array)@func_get_arg(1));
require __DIR__ . "/template_helpers.php";
require __DIR__ . "/" . $templatePath;
result = ob_get_clean();
if(@func_get_arg(2)) {
echo $result;
} else {
return $result;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment