Switch file
From Wikipedia, the free encyclopedia
This article may not meet the general notability guideline or one of the following specific guidelines for inclusion on Wikipedia: Biographies, Books, Companies, Fiction, Music, Neologisms, Numbers, Web content, or several proposals for new guidelines. If you are familiar with the subject matter, please expand or rewrite the article to establish its notability. The best way to address this concern is to reference published, third-party sources about the subject. If notability cannot be established, the article is more likely to be considered for redirection, merge or ultimately deletion, per Wikipedia:Guide to deletion. This article has been tagged since May 2008. |
The Fusebox switch file fbx_switch.cfm, in the Fusebox computer programming language, decides which fuses to call to accomplish the requested fuseaction. It is basically a CFSWITCH statement on the fuseaction variable with one or more CFLINCLUDEs to fuse files that do the actual work; the display (dsp_*.cfm), CFML actions (act_*.cfm) or SQL queries (qry_*.cfm). The resulting HTML is captured using CFSAVECONTENT by the Fusebox core file. It is then displayed by the layout file specified in this circuits fbx_layouts.cfm file. This helps separate graphical layout from code. The resulting HTML is passed back up through the parent circuits providing for nest layout of menu options. Similarly as errors are caught by the fbx_errorCatch.cfm file and may be optionally bubbled up through the parent circuits to the root circuit.
Finally the core file outputs the completed nested layout. Layouts may also be selected based on user interaction or personalization settings. A simple fbx_switch.cfm is shown below.
<cfswitch expression = "#fusebox.fuseaction#"> <cfcase value="showInputForm"> <cfset XFA.add = "admin.add"> <cfset XFA.edit = "admin.edit"> <cfset XFA.delete = "admin.delete"> <cfinclude template="dsp_InputForm.cfm"> </cfcase> <cfcase value="showEmployeeList"> <cfinclude template="qry_EmployeeList.cfm> <cfinclude template="dsp_EmployeeList.cfm> </cfcase> <cfdefaultcase> <cfoutput>I received a fuseaction called #fusebox.fuseaction#" that circuit "#fusebox.circuit#" doesn't have a handler for.</cfoutput> </cfdefaultcase> </cfswitch>