Last active
December 15, 2015 04:39
-
-
Save alanpich/5203205 to your computer and use it in GitHub Desktop.
Include a MODX static resource as a script tag in a document
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 | |
/** | |
* Create a snippet called 'javascript' with this content | |
*/ | |
return '<script type="text/javascript" src="'.$input.'"></script> |
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 | |
/** | |
* Create a snippet called 'stylesheet' with this content | |
*/ | |
return '<link rel="stylesheet" type="text/css" href="'.$input.'" /> |
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
<html> | |
<head> | |
... | |
[[~123:javascript]] | |
[[~321:stylesheet]] | |
</head> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment