Hello,
I'm looking into moving our legacy application written in FB5 into the Coldbox framework a section at a time and am having a problem with not being able to see output from a coldbox request. The general setup I went with is to put our coldbox code in a subfolder underneath the existing app like so:
-FB5App
--_coldbox
----handlers
----layouts
----model
----view
--controller
--model
--view
--Application.cfc
--index.cfm
We have set up a very basic hello world page in the coldbox app. We are also bootstrapping the CB framework in the application.cfc. Our 'onRequestStart()' method looks like this:
<cffunction name="onRequestStart" returnType="boolean" output="No">
<cfargument type="String" name="targetPage" required=true/>
<!---
Provide us a way to do some manual initialization
--->
<cfif IsDefined("url.refreshApp")>
<cfset onApplicationStart()/>
</cfif>
<!---
Relocate user to index.cfm if they aren't already going there
--->
<cfsilent>
<cfif right(cgi.script_name, Len("index.cfm")) NEQ "index.cfm" AND right(cgi.script_name, 3) NEQ "cfc">
<cflocation url="index.cfm" addtoken="no">
</cfif>
</cfsilent>
<cfset request.bypass_fusebox = false/> <!--- variable used to bypass fusebox processing in index file --->
<cfif StructKeyExists(url,'cbevent') or StructKeyExists(form,'cbevent')>
<!---// Process ColdBox Request--->
<cfset application.cbBootstrap.onRequestStart( arguments.targetPage )/>
<!--- set variable that will bypass fusebox code in the index file --->
<cfset request.bypass_fusebox = true/>
</cfif>
<cfreturn true>
</cffunction>
In our index.cfm I have this:
<cfsetting enablecfoutputonly="no">
<cfif not request.bypass_fusebox>
<cfinclude template="fusebox5.cfm">
</cfif>
Basically what I'm doing is checking to see if I have a URL/Form variable called 'cbevent' (the eventName setting has been configured in coldbox.config) and if I do i process the the request using Coldbox and if not I process using Fusebox. However when I call my main.home event I get no output from the request. I know CB is processing the event because if I put a 'cfabort' in the Main.cfm layout file I can see the output from my view. I have to be missing something simple?
Thanks.
Brett