Skip to content

Instantly share code, notes, and snippets.

@splittingred
Created August 3, 2011 21:20
Show Gist options
  • Save splittingred/1123798 to your computer and use it in GitHub Desktop.
Save splittingred/1123798 to your computer and use it in GitHub Desktop.
include snippet for MODX Revolution
if (empty($file)) return '';
$o = '';
$modx->parser->processElementTags('',$file,true,true);
$file = str_replace(array(
'{core_path}',
'{base_path}',
'{assets_path}',
),array(
$modx->getOption('core_path'),
$modx->getOption('base_path'),
$modx->getOption('assets_path'),
),$file);
if (file_exists($file)) {
$o = include $file;
} else { die('File not found: '.$file); }
return $o;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment