Last active
February 2, 2016 12:54
-
-
Save christianseel/401500aa8fedb9d64980 to your computer and use it in GitHub Desktop.
Usage: [[!regClient? &input=`markup or script here` &function=`htmlToBottom`]]
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 | |
$options = isset($options) ? $options : 'htmlToBottom'; | |
$function = $modx->getOption('function', $scriptProperties, $options); | |
$plaintext = (strstr($input, PHP_EOL)) ? true : false; | |
switch ($function) { | |
case 'cssToHead': | |
$modx->regClientCSS($input); | |
break; | |
case 'htmlToHead': | |
$modx->regClientStartupHTMLBlock($input); | |
break; | |
case 'htmlToBottom': | |
$modx->regClientHTMLBlock($input); | |
break; | |
case 'jsToHead': | |
$modx->regClientStartupScript($input,$plaintext); | |
break; | |
case 'jsToBottom': | |
$modx->regClientScript($input,$plaintext); | |
break; | |
} | |
return ''; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment