fusionbox 5.5 noxml 文件夹名称问题
我在使用 fusionbox 5.5 noxml 和电路时遇到问题...
我的结构如下所示。
controller
app.cfc
model
main
act_comm_main.cfm
monkey
act_something_else.cfm
view
main
dsp_comm_main.cfm
monkey
dsp_somethingElse.cfm
在 app.cfc 文件中我有这个:
<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>
这是行不通的。但如果我将其更改为具有名为:mainPages 的视图文件夹,然后更改 cfset myFusebox.执行查看 mainPages.dsp_comm_main (它出现),但在上面的实例中它给了我这个错误:
未定义的 Fuseaction
您指定了 dsp_comm_main 的 Fuseaction,但未在 主电路。
我删除了解析的文件并让保险丝盒重建,但我仍然收到此错误。
所以我知道如何通过在模型和视图文件夹之间命名不同的目录来解决这个问题,但为什么会发生这种情况,我该怎么做才能在模型视图中解析相同的命名目录?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是因为在 Fusebox 中,模型和视图只是实现 MVC 的约定。从技术上讲,它们只是一个电路,无论是显式的还是隐式的,都不重要。
电路名称在应用程序中必须是唯一的,因此您必须以不同的方式命名文件夹。
就我个人而言,我使用诸如
vMain/mMain
、vMonkey/mMonkey
之类的命名来表示具有许多视图电路的更复杂的应用程序。对于更简单的应用程序,只需layout
和display
视图电路就足够了,这样模型就可以在没有前缀的情况下命名。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.