Skip to content

Instantly share code, notes, and snippets.

@fomigo
Created November 12, 2012 14:37
Show Gist options
  • Save fomigo/4059751 to your computer and use it in GitHub Desktop.
Save fomigo/4059751 to your computer and use it in GitHub Desktop.
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