I'm building a CFC which will write a CFC.  It will do some
processing, then output to my browser, the code in text form, for me
to copy and paste into my editor to be modified.  The idea is for the
CFC i'm building to do a lot of the grunt work I do,  then i spend my
time doing the tweaks on the code.

It's a bit like ORM but I build quite a few CFCs for fairly common
purposes that don't always involve  a database.

Here's my question:   how can I write a CFC method,  which will output
formatted text?   I know there's <pre>  and <cfsavecontent>  but they
aren't giving me the output with linefeeds etc.     What have I
forgotten?    I know I did this once, a long time ago but I'm dashed
if I can remember how i got the line feeds and formatting.

For example here's the method that writes the header of the file, but
instead of producing a nicely formatted text block to the browser, it
puts it all in one line. :

  <cffunction name="Buildheader" access="public" returntype="string"
output="false" hint="Builds the file header text." >
        <cfargument name="Filename" type="string" required="yes" />
                <cfset var headertext="" />

    <cfsavecontent variable="headertext"><cfoutput>
&lt;cfsilent&gt;
&lt;!----
==========================================================================================================
Filename:    #Filename#.cfm
Description:
Date:          #dateformat(now(), "d/mmm/yyyy")#
Author:       Michael Kear

Revision history:

==========================================================================================================
---&gt;
</cfoutput></cfsavecontent>
<cfreturn headertext />
        </cffunction>


-- 
Cheers
Mike Kear
Windsor, NSW, Australia
Adobe Certified Advanced ColdFusion Developer
AFP Webworks
http://afpwebworks.com
ColdFusion 9 Enterprise, PHP, ASP, ASP.NET hosting from AUD$15/month

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:332426
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to