Whatever message this page gives is out now! Go check it out!
StructSetMetaData(Struct struct, Struct metadata)Parameters | Description |
struct | (Required) The input structure. |
metadata | (Required) Metadata to be applied to the struct key(s). |
<cfscript>
example = structnew("ordered");
example.firstname = "Yes";
example.lastname = "Man";
example.address={"Street":"123 Any street","House":"20"};
// changing the default serialization by specifying the type of "firstname" as string
metadata = {firstname: {type:"string",name:"fname"},lastname:{name:"lname"},address:{keys:{"house":{type:"string",name:"House number"}}}};
StructSetMetaData(example,metadata);
writeoutput(SerializeJSON(example) & "<br/>");
</cfscript>