Reputation: 482
This week I just try to recall Fw1 framework. But, I faced fw1 core file error. Below screen has my folder structure,
Inside the lib folder, I have one more folder called a framework. The framework folder also has one.cfc & ioc.cfc files. Now, I'm trying to run my application in the browser. It's throwing below error.
Could not find the ColdFusion component or interface C:\ColdFusion2016\cfusion\wwwroot\try\Fw1Demo\framework\ioc.cfc
But, In my Application.cfc I have extended fw1 one.cfc core file.
component extends="lib.framework.one" output="false" {
}
But, I'm not sure why this is throwing an error.
Upvotes: 2
Views: 859
Reputation: 111
Instead of changing the core files, please, try the following.
variables.framework = {diComponent = "framework.ioc"}
This way, you will not change the core files and still have what you want.
Upvotes: 0
Reputation: 690
Fw1 is a light weight framework and have that is called convention over configuration. We can configure it in the Application.cfc
As per my knowledge, If you want to configure that you don't touch the core files. Just add it into the Application.cfc
Its like the default Section, Item and the reloadApplicationOnEveryRequest setup like
variables.framework = {
defaultSection = 'dashboard',
defaultItem = 'default',
reloadApplicationOnEveryRequest = false
};
For your scenario you should add in Application.cfc like,
variables.framework = { applicationKey = 'lib.framework.one'; }
For its only the application specific configuration. I didn't try the configure like that but we can do the configuration like this.
Upvotes: 2
Reputation: 482
Now, We can able to put fw1 framework core files in a different folder. We don't need to follow the fw1 mentioned folder structure. I mean, framework/one.cfc & framework/ioc.cfc
.
But, for using different folder structure need to change the path in framework/one.cfc
. In this file, they are used as a static path to point out the ioc.cfc file. We need to change that path.
In my above questions, I used lib/framework/one.cfc & lib/framework/ioc.cfc
. So, In one.cfc
file, need to change the below code,
var diComponent = 'lib.framework.ioc';
variables.framework.applicationKey = 'lib.framework.one';
By default, the above mentioned variables have the below values,
var diComponent = 'framework.ioc';
variables.framework.applicationKey = 'framework.one';
So, In this variables need to update our path.
Thanks,
Upvotes: 2