Created
June 27, 2012 20:30
-
-
Save SBoudrias/3006693 to your computer and use it in GitHub Desktop.
MODx snippet to load template with file system
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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