In my variables.framework there seems to be a diff...
# fw1
d
In my variables.framework there seems to be a difference between the starter app (box fw1 skeleton) and one of my old fw/1 apps. The new application has these config settings:
Copy code
...
diEngine = "di1",
diComponent = "framework.ioc",
diLocations = "model, controllers"
...
whereas my old application doesn’t specify the diEngine or diComponent and has the following diLocation format:
Copy code
diLocations : [ "/controllers", "/model" ]
Should it be an array or a list? I’ll have to try again tomorrow now.
t
Both should be supported. Passing a list or array will yield the same outcome. The CommandBox module for generating an app skeleton probably uses a list, simply based on some example config code at the time. (I am the creator of that tool, and it does need some update love 😅)
d
Thanks for clarifying. At the moment I'm trying to work out the differences between this new application which is throwing an error and an existing application which is working. I clearly have missed a step somewhere.
t
Been a while since I've setup an app with the list approach as I tend to pass an array. This is just a shot in the dark as I'm not in front of a computer to test, but I notice the list doesn't include “/“ in the locations. Not sure if that makes a difference offhand.
d
Thanks, I'll make some changes tomorrow and see if it makes the difference
👍🏻 1
This morning I have removed the diEngine and diComponent from the config and switched the diLocations to the array format. I no longer see the invalid component definition error - hurrah! Now onto the next issue. I am just getting the onMissingView() function for any page. I have added the following to my onMissingView() method in Application.cfc:
Copy code
var loc = {};
		loc.rqc = serialize(rc);
		return "Error 404 - Page not found.<br />#loc.rqc#";
If I load a page, e.g. /about (?action=home.about) I get this:
Copy code
Error 404 - Page not found
{"action":"home.about"}
the fw/1 routes appear to be working:
Copy code
routes = [
	{ "/about/?$" = "/home/about" }
    ...
]
and I have this in variables.framework:
Copy code
variables.framework = {
	reload = "reload",
	password = "*********",
	action = "action",
	defaultSection = "home",
	defaultItem = "index",
	error: "home.error",
	missingview: "home.error",
	generateSES = true,
	SESOmitIndex = true,
	diLocations = [ "/controllers", "/model" ],
    diConfig = {...},
    routes = [...]
}