<cfstatic>
defines a static constructor within components
This tag must have a body.
This tag is also supported within <cfscript>
Introduced: 5.0.0.0
<cfstatic><!--- body ---></cfstatic>
This tag does not use any attributes.
Examples
<cfcomponent>
<!--- inside the static constructor you can define static variables, this code is executed when the "class" instance is loaded --->
<cfstatic>
<cfset susi=1> <!--- written to the static scope (defining the scope is not necessary) --->
<cfset static.sorglos=2> <!--- again written to the static scope --->
</cfstatic>
<cfcomponent>
See also
- Components (CFCs)
- Static
- <cfcomponent>
- Search Issue Tracker
- Search Lucee Test Cases (good for further, detailed examples)