Another thing to keep in mind is that you could also use a cftag!

For example
<cfmodule template="form.cfm" attribute="Hello">

CFC's are good but it should not be wise to use html in a cftag, it looks
cleaner if cfc's are used for business logic.


Regards,
Andrew Scott
 
Quote of the Day:
People wish to be settled. It is only as far as they are unsettled that
there is any hope for them. - Ralph Waldo Emerson
-----Original Message-----
From: Russ [mailto:[EMAIL PROTECTED] 
Sent: Sunday, 9 October 2005 11:17 AM
To: CF-Talk
Subject: RE: Coldfusion - i'm moving on

We have a lot of shared database code that we put in CFC's, and I started
creating different CFC's into which I put shared html code.  The nice thing
about cfc's vs includes is that you can pass arguments into cfc methods and
alter how the form looks/acts based on those arguments... 

Russ

-----Original Message-----
From: Saturday (Stuart Kidd) [mailto:[EMAIL PROTECTED] 
Sent: Saturday, October 08, 2005 4:33 PM
To: CF-Talk
Subject: Coldfusion - i'm moving on

Hi guys,

I'm quite happy with myself because after so long i've been using CF  
i haven't always been using it in 'rapid development'... but today  
instead of keep re-writing code, usually in a copy & paste style then  
a re-hash of variable names etc I decided I was going to create an  
include file so I could reuse a form.  In this case it was a 'contact  
us form'.

I created an include file that had a form in it and also a <cfif  
isDefined> type thingy so that if the form had been submitted then it  
would action that.

So I have on my main page:

---------------------------------------------------------------------
                 <!--- contact us form --->
                 <cfset actionPage = "/index_02005ii.cfm?cp=13">
                 <cfinclude template="/webs/02005/includes/ 
include_formContactUs.cfm">
                 <!--- end of contact us form --->
---------------------------------------------------------------------

AND ON my include_formContactUs.cfm I have:

---------------------------------------------------------------------

<cfif isDefined('sendContact')>
Blah blah
</cfif>

My form

---------------------------------------------------------------------

However, I know this is probably the right time for me to do it  
another way, but i'm just not sure how to do it.  It works fine the  
way it is but i know that for instance i have set the actionPage but  
i'm sure there is a different way of doing that?  It's not a  
CFFUNCTION i have to make is it?

Is it worth doing it for this?  I'm sure it would come handy because  
so often I have written 'contact us' type action forms.

Thanks for your help,

Saturday






~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Logware (www.logware.us): a new and convenient web-based time tracking 
application. Start tracking and documenting hours spent on a project or with a 
client with Logware today. Try it for free with a 15 day trial account.
http://www.houseoffusion.com/banners/view.cfm?bannerid=67

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:220492
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to