Skip to content

Instantly share code, notes, and snippets.

@alanpich
Last active December 15, 2015 04:39
Show Gist options
  • Save alanpich/5203205 to your computer and use it in GitHub Desktop.
Save alanpich/5203205 to your computer and use it in GitHub Desktop.
Include a MODX static resource as a script tag in a document
<?php
/**
* Create a snippet called 'javascript' with this content
*/
return '<script type="text/javascript" src="'.$input.'"></script>
<?php
/**
* Create a snippet called 'stylesheet' with this content
*/
return '<link rel="stylesheet" type="text/css" href="'.$input.'" />
<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