I am having trouble with fusebox 5.5 noxml and circuits...
I have a structure that looks like this.
controller
app.cfc
model
main
act_comm_main.cfm
monkey
act_something_else.cfm
view
main
dsp_comm_main.cfm
monkey
dsp_somethingElse.cfm
In the app.cfc file I have this:
<cffunction name="postfuseaction">
<cfargument name="myFusebox" />
<cfargument name="event" />
<!--- do the layout --->
<cfset myFusebox.do( action="layout.lay_template" ) />
</cffunction>
<cffunction name="main">
<cfargument name="myFusebox" />
<cfargument name="event" />
<!--- do model fuse --->
<cfset myFusebox.do( action="moneky.act_somethingElse" ) />
<!--- do model fuse --->
<cfset myFusebox.do( action="main.act_comm_main" ) />
<!--- do display fuse and set content variable body --->
<cfset myFusebox.do( action="main.dsp_comm_main", contentvariable="body" ) />
</cffunction>
</cfcomponent>
This doesn't work. but if I change it to have the view folder named: mainPages so and then change the cfset myFusebox. do to look at mainPages.dsp_comm_main (it comes up) but in the instance above it give me this error:
undefined Fuseaction
You specified a Fuseaction of dsp_comm_main which is not defined in Circuit main.
I remove the parsed files and let fusebox rebuild but I still get this error.
So I know how to work around it by naming my directories different between the model and view folders but why is this happening and what can I do to get to resolve same named directories across the model view?
This is because in Fusebox models and views are just a convention to implement MVC. Technically they just a circuits, explicit or implicit, doesn't matter.
Circuit name must be unique within the application, so you have to name the folders differently.
Personaly I've used naming like
vMain/mMain
,vMonkey/mMonkey
for more complex apps with many view circuits. For simpler apps it could be enough to have justlayout
anddisplay
view circuits, this way models can be named without prefix.