Skip to content

Instantly share code, notes, and snippets.

@SBoudrias
Created June 27, 2012 20:30
Show Gist options
  • Save SBoudrias/3006693 to your computer and use it in GitHub Desktop.
Save SBoudrias/3006693 to your computer and use it in GitHub Desktop.
MODx snippet to load template with file system
<?php
# 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