Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Everyday modx snippets
<?php
/*** GetTemplate ***/
include MODX_CORE_PATH . 'custom/templates/' . $modx->resource->template . '.html';
return;
/*** Include ***/
$chunk = $modx->getOption('chunk', $scriptProperties, false);
$snippet = $modx->getOption('snippet', $scriptProperties, false);
if ($chunk) {
include MODX_CORE_PATH . 'custom/chunks/' . $chunk . '.html';
} else if ($snippet) {
return include MODX_CORE_PATH . 'custom/snippets/' . $snippet . '.php';
}
/*** TraceGlobals ***/
$output = '';
$output .= PHP_EOL . '====== GET =========' . PHP_EOL . print_r($_GET, true);
$output .= PHP_EOL . '====== POST ========' . PHP_EOL . print_r($_POST, true);
$output .= PHP_EOL . '====== COOKIE ======' . PHP_EOL . print_r($_COOKIE, true);
$output .= PHP_EOL . '====== SESSION =====' . PHP_EOL . print_r($_SESSION, true);
return $output;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.