Where in coldbox would you add a function that would be visible in your view thats global for instance, i want to create a function that replaces spaces with hyphens for a URL
public string function makeUrl(url) {
replace bit here
return URL;
}
where would you store this?
You can create a view helper.
This is a page with that can contain user defined ColdFusion functions. Your view will have automatic access to it.
More details here: https://coldbox.ortusbooks.com/the-basics/layouts-and-views/views/view-helpers
However, for your specific case, you may want to consider using JavaScript instead.