Skip to content

Commit 455416b

Browse files
committed
Add ability to specify the moduleRootURL
1 parent 3267ae8 commit 455416b

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

ModuleConfig.cfc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ component {
2424
* Capture our module root for use throughout CBWIRE.
2525
*/
2626
"moduleRootPath": getCanonicalPath( getCurrentTemplatePath().replaceNoCase( "/ModuleConfig.cfc", "", "one" ) ),
27+
/**
28+
* The URL to the module root. The sometimes needs to be overridden for certain server configurations.
29+
*/
30+
"moduleRootURL": "/modules/cbwire",
2731
/**
2832
* Set to true to throw a 'WireSetterNotFound' exception if
2933
* the incoming cbwire request tries to update a property

models/scripts.cfm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<cfoutput>
22
<!-- CBWIRE SCRIPTS -->
3-
<script src="#getEvent().getModuleRoot( 'cbwire' )#/includes/js/livewire.js?id=239a5c52" <cfif not moduleSettings.showProgressBar>data-no-progress-bar</cfif> data-csrf="#generateCSRFToken()#" data-update-uri="#getUpdateEndpoint()#" data-navigate-once="true"></script>
3+
<script src="#moduleSettings.moduleRootURL#/includes/js/livewire.js?id=239a5c52" <cfif not moduleSettings.showProgressBar>data-no-progress-bar</cfif> data-csrf="#generateCSRFToken()#" data-update-uri="#getUpdateEndpoint()#" data-navigate-once="true"></script>
44

55
<script data-navigate-once="true">
66
document.addEventListener('livewire:init', () => {

test-harness/config/Coldbox.cfc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ component{
8181

8282
moduleSettings = {
8383
"cbwire" = {
84-
"autoInjectAssets" : true
84+
"autoInjectAssets" : true,
85+
"moduleRootURL": "/moduleroot/cbwire"
8586
},
8687
"cbi18n": {
8788
// The default resource to load and aliased as `default`
@@ -112,6 +113,7 @@ component{
112113
moduleName = request.MODULE_NAME,
113114
invocationPath = "moduleroot"
114115
);
116+
controller.getRenderer().loadApplicationHelpers( true );
115117
}
116118

117119
}

0 commit comments

Comments
 (0)