Skip to content

Instantly share code, notes, and snippets.

@Elijen
Created February 1, 2014 11:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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