// &file=`assets/foo/bar.php` indicates the file to include // &return=`1` return explicit content from return statement in included file // default behavior is to use output buffering to capture the content from the include $output = ''; if (isset($filename) && file_exists($filename)) { if (!isset($return) || $return == false) { ob_start(); include ($modx->config['base_path'] . $filename); $output = ob_get_contents(); ob_end_clean(); } else { $output = include ($modx->config['base_path'] . $filename); } } return $output;