House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home /  Groups /  ColdFusion Talk (CF-Talk)

creating a cfc

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Daniel Kessler
02/14/2008 03:18 PM

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

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Paul Kukiel
02/14/2008 03:48 PM

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 -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Wally Randall
04/08/2008 03:00 PM

Did you ever get this working?  I have a need for just such a beast.

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Dave Watts
02/14/2008 03:27 PM

> 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/


<< Previous Thread Today's Threads Next Thread >>

Search cf-talk

May 24, 2012

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
     1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31     

Designer, Developer and mobile workflow conference