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

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


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


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

Aaron Greenlee

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:


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 that accepts some extra paramaters:

public string function buildLink(
string linkto=’’
,boolean translate
,boolean ssl
,string baseURL
,string queryString
,boolean senseLanguage=true
,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