Module config

Got a strange problem with my module, and I suspect it's something to
do with the way my routes are setup.

Basically, my module is called "mxtra", and I have the following in my
routes.cfm file:

addModuleRoutes(pattern="/mxtra",module="mxtra");

Then in my moduleconfig.cfc I have some SES routes setup as follows:

{pattern="/shop/category/:action?",handler="shop.category"},
{pattern="/shop/basket/:action?",handler="shop.basket"},
{pattern="/shop/product/:action?",handler="shop.product"},
{pattern="/shop/checkout/:action?",handler="shop.checkout"},

However, the non-SES route doesn't seem to work:

/mxtra:shop/category gives me a mxtra:shop.category is not valid
registered event., yet /mxtra/shop/category works fine!?

this is a problem, as I'm using the SSL interceptor, and it redirects
to /mxtra:shop/category as it's using the framework current event.

If I turn on debugging, and look at the current event, it says /
mxta:shop/category - but I can't use that in my URL...

I'm a bit stuck!

This is because you don't call the module like this in the URL?

The addModuleRoute is the key here this is the URL info that will be used to
call your module, so in your case you have /mxtra so to see this in the URL
it would be /mxtra/shop/category

Hope that helps.

Regards,
Andrew Scott
http://www.andyscott.id.au/

From: coldbox@googlegroups.com [mailto:coldbox@googlegroups.com] On
Behalf Of Tom Miller
Sent: Tuesday, 14 September 2010 1:29 AM
To: ColdBox Platform
Subject: [coldbox:5762] Module config

Got a strange problem with my module, and I suspect it's something to do
with the way my routes are setup.

Basically, my module is called "mxtra", and I have the following in my
routes.cfm file:

addModuleRoutes(pattern="/mxtra",module="mxtra");

Then in my moduleconfig.cfc I have some SES routes setup as follows:

{pattern="/shop/category/:action?",handler="shop.category"},
{pattern="/shop/basket/:action?",handler="shop.basket"},
{pattern="/shop/product/:action?",handler="shop.product"},
{pattern="/shop/checkout/:action?",handler="shop.checkout"},

However, the non-SES route doesn't seem to work:

/mxtra:shop/category gives me a mxtra:shop.category is not valid

registered

Yeah I'm not calling the module like that - the SSL interceptor is
doing that!

However, from what I understand, I *should* be able to call the module
like that (i.e /mxtra:shop/category) if I want to, but I can't.

The SSL interceptor uses event.buildLink() to redirect, so coldbox is
creating this URL for me.