I want to intercept the route before it goes through route handling
and I can't find away to do it.
I am trying to create a cms app with ColdMVC and I have a page object
with a property called "address" on in it. Example "products/". My
plan is to append the address to the link. Example
www.myDomain.com/public/index.cfm/products/. My goal is to check if
the address exists in a page object and if it does, to NOT execute the
routeHandling and allow me to intercept the request and handle it.
I tried to make a route like this :
<cfset add(":action", {
default= {
controller = "cmsView",
action="render"
}
}) />
But the default route for forms in ColdMVC gets replaced by this one,
so my forms break.
Next I tried invalidController and invalidAction, but the event view
key gets jacked up so I try to parse the address. It ends up looking
like this /products/.cfm...which is kinda funky.
CMSViewController.cfc
/**
* @events invalidController, invalidAction
*/
function render(){
params.page =
_CMSPage.findByAddress(trim(replaceNoCase($.event.get().view,".cfm","/","all")));
params.html = params.page.html();
$.event.action("view");
$.event.controller("cmsView");
$.event.view("/cms/index.cfm");
}
Any ideas on how I could capture the request and handle it before the
route handling kicks in?