Content deleted Content added
C++ section: Clarified part about copy ctors. |
Da cameron (talk | contribs) Changing "ColdFusion" to "CFML": CFML is the language; ColdFusion is a vendor implementation. Adding code example for initmethod |
||
Line 365:
</source>
===
[[
'''Cheese.cfc'''
<source lang="javascript">
component
// properties
property name="cheeseName";
Line 386:
<source lang="javascript">
myCheese = new Cheese( 'Cheddar' );
</source>
Since ColdFusion 10<ref>[https://wikidocs.adobe.com/wiki/display/coldfusionen/cfcomponent CFComponent]</ref>, CFML has also supported specifying the name of the constructor method:
<source lang="javascript">
component initmethod="Cheese" {
// properties
property name="cheeseName";
// constructor
function Cheese Cheese( required string cheeseName ) {
variables.cheeseName = arguments.cheeseName;
return this;
}
}
</source>
|