Skip to content

Instantly share code, notes, and snippets.

@argnist
Created December 26, 2013 11:48
Show Gist options
  • Save argnist/8132776 to your computer and use it in GitHub Desktop.
Save argnist/8132776 to your computer and use it in GitHub Desktop.
printPlaceholders snippet
<?php
if (!$modx->user->isAuthenticated('mgr')) return;
$placeholders = $prefix ? array() : $modx->placeholders;
if ($prefix) {
foreach ($modx->placeholders as $key => $ph) {
if (strpos($key, $prefix) === 0) {
$placeholders[$key] = $ph;
}
}
}
return '<pre>' . print_r($placeholders, true) . '</pre>';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment