$include() not working CB 3.0

Using ColdBox 3.0.0 RC1-318-GENESIS-14:14

I was trying to use $include() on a view and it wasn't working.
I then used cfinclude and it worked.
So I looked at the frameworksupertype.cfc method:

<!--- Include Facade --->
<cffunction name="$include" access="public" hint="Facade for
cfinclude" returntype="void" output="false">
  <cfargument name="template" type="string">
  <cfinclude template="#arguments.template#">
</cffunction>

Why is "output" false? I changed it to "true" so it would work, but
how did this bug get past unit testing? Any ways, is this something
that needs fixed or is it fixed in the latest build and I got a bad
egg?

Hi Clint,

If you want to include a view from another view then instead of using $include, I suggest that you look at the renderView method. All you need to do is something like this:

someview.cfm

Ok, I knew this too, I use renderView() to include header, footer,
navs, menus, etc.. But good point, thanks.

So.. what's the point of $include(), and again, why make it part of
the documentation if it doesn't work?
Or is it supposed to work?

I changed it, to tell you the truth, I built the facades, but I myself have never used them since I mostly use what the framework gives anyways. So, in conclusion, good job for finding the bug and reporting it!

Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Interesting. I always thought it was for mixing in function libraries (before this was added to the framework) rather than for views in which case you’d want output=false to stop whitespace.

Either way I guess it shows what a flexible framework coldbox is! :slight_smile:

– sent by a little green robot

for mixins I would say use: includeUDF() which is basically built for mixins of UDFs and CFCs
Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com