passing attributes
Hi,
I can pass attributes to a CFC like this but how do I use them? I tried <cfoutput>#firstname</cfoutput> but firstname is undefined.
<cfinvoke component="toastcfc/header" method="header" firstname="john" lastName="kidd">
Hi,
I can pass attributes to a CFC like this but how do I use them? I tried <cfoutput>#firstname</cfoutput> but firstname is undefined.
<cfinvoke component="toastcfc/header" method="header" firstname="john" lastName="kidd">
A few typo's that may or may not be in your actual code:
<cfoutput>#firstname</cfoutput>
Should be
<cfoutput>#firstname#</cfoutput>
or better yet
<cfoutput>#arguments.firstname#</cfoutput>
and
<cfinvoke component="toastcfc/header" method="header" firstname="john" lastName="kidd">
Should be
<cfinvoke component="toastcfc.header" method="header" firstname="john" lastName="kidd" />
Let's assume that your actual code is correct. In that case you must have a directory called toastcfc (or a mapping) and in it a file called header.cfc and in it a function called header. What does the actual code in the <cffunction ... > look like? Do you have a <cfargument name="header" type="string"> tag?
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.