I have a .cfc file with all my functions in it (wrapped in a <cfcomponent>
tag), including this one:
<cffunction name="getFooter" output="false" access="public" returnType="string">
<cfargument name="showFooter" type="string" required="false" default="" />
<cfreturn footer />
<cfset application.lib.getFooter(arguments.footer)>
</cffunction>
<cfset footer = getFooter(footer="<footer class="text-center">I am a footer.</footer>") />
And in my .cfm file, I put:
<cfoutput>#footer#</cfoutput>
It is not displaying the footer.
When I have all of this in a single .cfm file, it works fine.
I need to be able to store the function in my .cfc file and call it from anywhere in the application.
What am I missing?
Yet another way to cut it:
Application.cfc
Lib.cfc
Then, in any CFM file in the application: