yes you can - sort of... but it's a bit more of a manual process (thus
more controllable)
Your layout.cfm will contain all your wrapper bits as you have
described (css, js, headers etc) and will call renderView() in the
middle somewhere.
Now say you have a handler (circuit) FOO that you want to apply a
specific style to for all its views. The most direct port from Fusebox
I can think of would be to call your view as normal, but instead of
outputting the result you save it to a variable. Then call your nested
layout at the end to wrap the output.
For example:
handlerView.cfm: (called by your handler) - this will output your
view content into a variable
<cfsavecontent variable="viewContent">
my regular view content goes here
</cfsavecontent>
<cfset renderView("nestedLayout")>
nestedLayout.cfm: - take the view content and wrap it into a sub-
layout which will be taken into the main layout
<cfoutput>
</cfoutpout>
layout.cfm
<cfoutput>
<div id="mainWrapper">
#renderView()#
</div>
</cfoutput>
the end result of this should be:
<div id="mainWrapper">
<div id="nestedViewWrapper">
my regular view content goes here
</div>
</div>
I've done something similar with my app (which I'm also porting from
fusebox, as it happens), but have taken it a step further and created
a LayoutManager plugin (or more accurately - turned an existing cfc
used in the fusebox version into a plugin) -- this is just a
convenience thing which gives me an API for my views to add their
content (customs scripts, css, etc). It's a persistent object and
makes use of flashram to store view data per request.
This was useful to me as we make use of a lot of XSL/XML
transformation to generate forms etc -- this way my views can generate
XML, stash everything in a central place to be transformed when it's
time to render the output.
My Layout.cfm makes a call to another view which accesses the content
stored in the layoutManager and renders it. None of my directly
accessed views actually generate content - they all stash their bits
and pieces as xml in the layoutManager.
Apart from some tidying up in the transition I really haven't had to
change much of the layout code from the original fusebox
implementation - it dropped straight in.
many ways to skin the cat - hope that helps!