serializes the component data into JSON, XML or CSV format

array|string serialize(string type,function callback);


typestringoptional, the format that the data will be serialized into (json, csv, xml), json by default
callbackfunctionoptional, a function that will be applied to every item of the component


array|stringserialized data of the component either as an array of JSON objects or as a CSV/XML string


// serialize data to an array of JSON objects;
// serialize data to an XML string"xml");
// serialize data to a CSV string"csv");

Back to top