Fix declaring multiple resources at once


The ColdBox docs state that you can declare multiple resources at once in the Router.cfc#resources method, either as an array
or as a list. In practice, neither work completely. An array throws an error in the framework and a list does not use the correct handler. This commit fixes that behavior, but with some caveats.

First, the handler is no longer defaulted in the parameter list. It is instead defaulted each loop through the resources. If you are only passing in the first argument to resources nothing really changes. If you specify the handler argument manually, it will use that handler for each loop.

This is fine for registering a single resource, but is probably not what you want for multiple resources. In fact, this method's arguments don't work well when declaring multiple resources if you are not using the defaults. I have seen that most projects end up declaring resources one at a time to change something like handler or parameterName. I would argue that it would make ColdBox simpler and fit the usage in the developer world to make a resource method that registers a single resource and expect the developer to call it for each resource they want to register. This could be introduced while deprecating the resources call for future removal from the framework.


Luis Majano


Eric Peterson



Fix versions