Skip to content

Instantly share code, notes, and snippets.

@ixth
Created April 24, 2011 14:42
Show Gist options
  • Save ixth/939590 to your computer and use it in GitHub Desktop.
Save ixth/939590 to your computer and use it in GitHub Desktop.
Snippet to include template files from file system
<?php
# Not my own, found it here: http://modxcms.com/forums/index.php?topic=40053
# Snippet to include template files from file system
# USAGE: [[includeTemplate? &tpl=`mytemplate/template.html`]]
if ( !isset($tpl) || $tpl== "" ) return "Missing Template file!";
$tpl = $base_path . 'assets/templates/' . $tpl;
ob_start();
include($tpl);
return ob_get_clean();
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment