我对fusebox 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 (出现了),但在上面的实例中,它给出了以下错误:
未定义熔断器
您指定了dsp_comm_main的熔断器,该熔断器在电路主电路中没有定义。
我删除分析过的文件,让熔断器重新构建,但我仍然会得到这个错误。
因此,我知道如何通过在模型文件夹和视图文件夹之间命名我的目录来解决这个问题,但是为什么会发生这种情况,我如何才能在模型视图中解析相同的命名目录呢?
发布于 2011-12-02 23:54:13
这是因为在Fusebox中,模型和视图只是实现MVC的惯例。从技术上讲,它们只是一个明显的或隐含的回路,并不重要。
电路名称在应用程序中必须是唯一的,因此您必须对文件夹进行不同的命名。
我用vMain/mMain
、vMonkey/mMonkey
这样的名字来命名更复杂的、有很多视图电路的应用程序。对于简单的应用程序,只要有layout
和display
视图电路就足够了,这样就可以不用前缀来命名模型了。
https://stackoverflow.com/questions/8362043
复制相似问题