Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Re-useable snippet cfc?

Status
Not open for further replies.

JohnandSwifty

Technical User
May 31, 2005
192
GB
Hi,

I have a system that regularly requires that i write extentions for it (be it extra functions or entire new modules). I'm planning to use cfc's for common functions like creating a list of tabs etc. I dont have access to UDF's, is there still a better way than using cfc's?

Thanks
 
generaly most developers I know / read about / talk to..

UDF's, CFC's and Custom Tags are all different and have different +'s & -'s

I dont have access to UDF's,

I don't get it? <cffunction inline with your code won't even work? but you can use CFC's?





Kevin

Phase 1: Read the CFML Reference
Phase 2: ???
Phase 3: Profit!
 
Sorry! I meant to say custom tags (stupid late night mistake). Either way i suppose what im asking is what is the best way to create 'something' that enables me to call a tab creation 'function' that will return me the html. In the the past I have used cfc's and fed them tab quantity, style, etc. Without using custom tags, is there a better way to do this? Would custom tags even be a better way of doing this?

Thanks
 

Do you mean that you don't have access to the custom tags directory on your server? If so, that doesn't matter. CF will look in the directory of the currently executing file, and then work up the tree, and then look in the custom tag directory.

So you could create a file within your site, and access it in the same way as you would with any other custom tag.

I personally would go with a cfc, just because i prefer the calling syntax.

Code:
<cfinvoke component="something" method="anything" returnvariable="myString">
 <cfinvokeargument name="vbl1" value="1">
 <cfinvokeargument name="vbl2" value="2">
</cfinvoke>

as apposed to

Code:
<cf_anything vbl1="1" vbl2="2" />

Hope this helps!

Tony
 
O! I was under the impression (probably through lack of research!) that custom tags could only reside in the custom tags directory - thanks!

As for the cfc this is how i do it at the moment, glad to hear its not such a bad idea!

John
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top