Created
November 12, 2012 14:37
-
-
Save fomigo/4059751 to your computer and use it in GitHub Desktop.
Everyday modx snippets
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 | |
/*** 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