Last active
December 12, 2018 17:16
-
-
Save jonleverrier/878887b7ae3f31de0b0ca3890a16bf0f to your computer and use it in GitHub Desktop.
Log the output of a placeholder or snippet to the MODX error log. Useful for checking what a placeholder actually outputs...
This file contains 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 | |
/* | |
logOutput snippet for MODX | |
Use like this: | |
[[!logOutput? &input=`[[+placeholder]]`]] or | |
*/ | |
if (empty($input)) { | |
$modx->log(1, "The output was empty",'','[logOutput]'); | |
} else { | |
$modx->log(1, "Output: " . $input,'','[logOutput]'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment