Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@gpickin
Last active January 1, 2016 13:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gpickin/8155035 to your computer and use it in GitHub Desktop.
Save gpickin/8155035 to your computer and use it in GitHub Desktop.
CFC for testing "new" operator vs traditional cfc component object creation
<cfcomponent initmethod="init">
<!--- init is the default or implied method --->
<!--- having an incorrect initmethod name will cause the cfc to error --->
<cffunction name="init">
<cffile action = "append" file = "#expandpath('./testing.txt')#" output = "#getTickCount()# - Init">
</cffunction>
<cffunction name="myinitmethod" access="private">
<!--- having a private method will cause the cfc to error --->
<cffile action = "append" file = "#expandpath('./testing.txt')#" output = "#getTickCount()# - InitMethod">
<cfreturn this>
</cffunction>
</cfcomponent>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment