Anyone know a nicer way of writing this in Config settings (.cfc)

Does anyone know a short way of writing this in ColdBox settings?

‘https://#cgi.server_name#/#variables.coldbox.appName#/index.cfm?#variables.coldbox.eventName#=Finance.error’

It seems a bit long winded for me but I can’t find anything under the CB bonnet that could help.

We’re not using Routes and running on CB 3.0

Cheers,
James

Looks good to me. You may want to decorate the Event.buildLink() method to avoid repeating it?

Aaron Greenlee
http://aarongreenlee.com/

Thanks Aaron. I just thought there might be something “under the bonnet” of CB that I might have missed along the way.

What are you thinking in terms of the buildLink decoration though? You’ve got me curious :slight_smile:

Cheers,
James

You can create a RequestCoontextDecotrator and modify the behavior of the Event Object to support specific needs that are unique to your application. In this case, if many of your links need to meet the format you explained you can modify the buildLink() method to work that way you want. For example, this is the function signature for a BuildLink I use on tv.adobe.com that accepts some extra paramaters:

public string function buildLink(
string linkto=’’
,boolean translate
,boolean ssl
,string baseURL
,string queryString
,boolean senseLanguage=true
,language
,boolean senseMobile=false
) { … }

Now, I can still call Event.buildLink() in my application and create complex links like you shared without having to repeat myself or come up with some UDF.

Aaron Greenlee
http://aarongreenlee.com/