Skip to content

Instantly share code, notes, and snippets.

@sjungling
Last active December 21, 2015 11:39
Show Gist options
  • Save sjungling/6300801 to your computer and use it in GitHub Desktop.
Save sjungling/6300801 to your computer and use it in GitHub Desktop.
<!---
Queues up specific packages that may not follow defined paths of themes/module/page
Example Usage: <cfset application.themeService.loadModule("build.modules.404") />
--->
<cffunction name="loadModule" returntype="void" access="public" output="true">
<cfargument name="module" type="string" />
<cflog text="loadModule called for #module#" />
<cfset var results = StructGet("application.assetMap.#module#") />
<cfif NOT structIsEmpty(results)>
<cfif StructKeyExists(results, "css")>
<cfset request.util.includeMultiple(includeList=ArrayToList(StructFind(results,"css"))) />
</cfif>
<cfif StructKeyExists(results, "js")>
<cfset request.util.includeMultiple(includeList=ArrayToList(StructFind(results,"js")), footer=true) />
</cfif>
</cfif>
</cffunction>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment