__construct()
_init()
forge()
to_array()
to_csv()
to_json()
to_jsonp()
to_php()
to_serialized()
to_xml()
to_yaml()
Format class
Help convert between various formats such as XML, JSON, CSV, etc.
package | Fuel |
---|---|
category | Core |
author | Fuel Development Team |
copyright | 2010 - 2012 Fuel Development Team |
link | http://docs.fuelphp.com/classes/format.html |
__construct(mixed $data, string $from_type, mixed $param)
mixed
general date to be converted
string
data format the file was provided in
mixed
additional parameter that can be passed on to a 'from' method
\FuelException |
---|
_init()
forge(mixed $data, string $from_type, mixed $param) : \Fuel\Core\Format
echo Format::forge(array('foo' => 'bar'))->to_xml();
mixed
general date to be converted
string
data format the file was provided in
mixed
additional parameter that can be passed on to a 'from' method
to_array(mixed $data) : array
Goes through the input and makes sure everything is either a scalar value or array
mixed
array
to_csv(mixed $data, mixed $delimiter, mixed $enclose_numbers, array $headings) : string
mixed
mixed
mixed
array
Custom headings to use
string
to_json(mixed $data, bool $pretty) : string
mixed
bool
whether to make the json pretty
string
to_jsonp(mixed $data, bool $pretty, string $callback) : string
mixed
bool
whether to make the json pretty
string
JSONP callback
string
formatted JSONPto_php(mixed $data) : string
mixed
string
to_serialized(mixed $data) : string
mixed
string
to_xml(mixed $data, null $structure, null | string $basenode, null | bool $use_cdata, mixed $bool_representation) : string
mixed
null
null
string
null
bool
whether to use CDATA in nodes
mixed
if true, element values are true/false. if 1, 1/0.
string
to_yaml(mixed $data) : string
mixed
string