We have a handler that inherits from a module’s handler. Is there any way to set it up so that the handler will find the view automatically in the module’s folder?
Here’s handler.cfc:
component extends=“testModule.handlers.testModuleHandler” {
public void function index(any event) {
}
}
The view is located in /modules/testModule/views/testModuleHandler/index.cfm.
At the moment we need to add this line to the “index” function to make it work:
event.setView(view=“testModuleHandler/index”, module=“testModule”);
How can we avoid having to add that line, and have CB automatically find the view in the module folder the same way it’s doing it for “external views”.
Just a note on the URL-- if you use SES urls, you can have full control over what the routes are.
To answer your original question-- no, the handler’s super class has no bearing on where views are looked for. You could probably make the “module” parameter a variable that’s paramed in your super’s “preHandler” or something.
I had the same problem by creating a new module with commendbox 3.3. The new custom module went into the folder “/modules_app” which is fine regarding the blog post
which makes sense to me. Even if it covers content box
But than I got the same error as Nick.
Not sure if this if “/modules_app” is the “new default” place for custom modules in any CB app. To avoid the error I had to move it to the “/modules” folder