Created
April 24, 2011 14:42
-
-
Save ixth/939590 to your computer and use it in GitHub Desktop.
Snippet to include template files from file system
This file contains hidden or 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 | |
# 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