RE: CFC style question (for UI CFCs)
Continuing this thread here... I like consistency too, and that's why I like to think of these as UI CFCs, and not just CFCs. I have business logic CFCs too, and they will never return output directly. (I name them differently and put them in a different location.) Custom tags are just too lame to force all shared UI-related stuff to be implemented with them I started avoiding cfinvoke in favor or this style of calling: cfoutput#variables.thingFormatter.outputTable(option1=x, option2=y)#/cfoutput because you can't tell if the method will output directly or return a string, but either way, it works. (I also like that you don't have to use quoted/pounds around the arguments... option1=x above is nicer looking to me than option1=#x#.) Q: Is there no way to have a string returned by a cfinvoked method automatically output? Do you really have to use returnVariable? Seems like that would be a nice shortcut to have... Thanks Mark -Original Message- From: Ken Ferguson [mailto:[EMAIL PROTECTED] Sent: Thursday, December 01, 2005 4:47 PM To: CF-Talk Subject: Re: CFC style question (for UI CFCs) As I often say, I like doing what fits the specific project best. Consitency is more important to me. If I'm going to avoid output from cfc's in a project, I'll avoid it consistently... --Ferg Will Tomlinson wrote: I like outputting directly myself. Will ~| 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:225915 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=11502.10531.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
RE: CFC style question (for UI CFCs)
Not that you *can't* output directly from CFCs, but I know many people will direct you against that practice. Many people tend to wrap business logic, functions, etc within CFC methods. Then, they will use custom tags for the display of the content. The custom tags will use CFCs to get their content. All in all, you can do pretty much what you want to do. You are right in that using CFSAVECONTENT is a better solution than just outputting directly from the method, itself. M!ke -Original Message- From: Gaulin, Mark [mailto:[EMAIL PROTECTED] Sent: Thursday, December 01, 2005 2:47 PM To: CF-Talk Subject: CFC style question (for UI CFCs) Hi I'm just starting to play with creating CFCs for UI components and I have a question about style. Is it better/more convenient/more maintainable/more readable to use output=true in your CFC methods (so the html goes right into the output), or to use output=false and have the method return a string, which the caller then has to display? The output=true way is pretty easy, but how do you control white space within the CFC? (Plus, it feels a little funny to have a CFC, even a UI one, generate output directly.) The output=false way can be a pain to code (use cfsavecontent a lot in your methods, I guess?), and how do you succinctly get the returned content into the output when using cfinvoke? Opinions? Thanks Mark ~| Discover CFTicket - The leading ColdFusion Help Desk and Trouble Ticket application http://www.houseoffusion.com/banners/view.cfm?bannerid=48 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:225868 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
Re: CFC style question (for UI CFCs)
I like outputting directly myself. Will ~| 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:225871 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
Re: CFC style question (for UI CFCs)
As I often say, I like doing what fits the specific project best. Consitency is more important to me. If I'm going to avoid output from cfc's in a project, I'll avoid it consistently... --Ferg Will Tomlinson wrote: I like outputting directly myself. Will ~| Find out how CFTicket can increase your company's customer support efficiency by 100% http://www.houseoffusion.com/banners/view.cfm?bannerid=49 Message: http://www.houseoffusion.com/lists.cfm/link=i:4:225873 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
Re: CFC style question (for UI CFCs)
now there is a shocker ~Dave the disruptor~ good sites - make money getting rid of ie :) http://explorerdestroyer.com/ http://www.killbillsbrowser.com/ From: Will Tomlinson [EMAIL PROTECTED] Sent: Thursday, December 01, 2005 4:31 PM To: CF-Talk cf-talk@houseoffusion.com Subject: Re: CFC style question (for UI CFCs) I like outputting directly myself. Will ~| 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:225890 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