|
Mailing Lists
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
creating a cfc
I'm trying to create a CFC and I am having a difficult time. ThisDaniel Kessler 02/14/08 03:18 P Try: <cfinvoke component="include.breadcrumb"Paul Kukiel 02/14/08 03:48 P Did you ever get this working? I have a need for just such a beast.Wally Randall 04/08/08 03:00 P > On the web page, I have:Dave Watts 02/14/08 03:27 P I'm trying to create a CFC and I am having a difficult time. This worked great as an include, but I thought it would be nice to learn something about objects. At this point, all I want to do is make an object, a method, and have it return something on a web page. Almost anything will do. I have: <cfcomponent namespace="breadcrumb" hint="breadcrumb" output="no"> <cffunction name="create_breadcrumb" access="public" returntype="string" output="false" hint="breadcrumb"> <cfargument name="current_file" type="string" required="no"> <cfset the_file_dir = GetDirectoryFromPath(GetTemplatePath())> <cfset the_file_dir = "sdfsdf"> <cfreturn the_file_dir> </cffunction> </cfcomponent> On the web page, I have: <cfinvoke component="/includes/breadcrumb.cfc" method="create_breadcrumb"> and I get the error: Could not find the ColdFusion Component or Interface /includes/ breadcrumb.cfc. It's in the includes directory. I'm sure it's something simple and I'm sure I'm a bit brain-dead at this point in the day, but any hint would be nice. thank you. -- Daniel Kessler University of Maryland College Park School of Public Health 3302E HHP Building College Park, MD 20742-2611 Phone: 301-405-2545 http://sph.umd.edu Try: <cfinvoke component="include.breadcrumb" method="create_breadcrumb"> Paul On 15/02/2008, at 6:54 AM, Daniel Kessler wrote: ----- Excess quoted text cut - see Original Post for more ----- Did you ever get this working? I have a need for just such a beast. > On the web page, I have: > <cfinvoke component="/includes/breadcrumb.cfc" > method="create_breadcrumb"> Component paths are described using dots, not slashes. Also, you don't specify the file extension. Finally, since your CFFUNCTION doesn't output anything, you need to capture the return value: <cfinvoke component="includes.breadcrumb" method="create_breadcrumb" returnvariable="breadcrumb"> <cfoutput>#breadcrumb#</cfoutput> Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ Fig Leaf Training: Adobe/Google/Paperthin Certified Partners http://training.figleaf.com/ WebManiacs 2008: the ultimate conference for CF/Flex/AIR developers! http://www.webmaniacsconference.com/
|
May 24, 2012
|
Latest Fusion Authority Articles
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||