__construct()
_init()
forge()
to_array()
to_csv()
to_json()
to_jsonp()
to_php()
to_serialized()
to_xml()
to_yaml()
_from_csv()
_from_xml()
_from_yaml()
pretty_json()
_from_json()
_from_serialize()
$_data
$ignore_namespaces
Format class
Help convert between various formats such as XML, JSON, CSV, etc.
__construct(mixed $data, string $from_type, mixed $param)
mixedgeneral date to be converted
stringdata format the file was provided in
mixedadditional 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();
mixedgeneral date to be converted
stringdata format the file was provided in
mixedadditional 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
arrayto_csv(mixed $data, mixed $delimiter, mixed $enclose_numbers, array $headings) : string
mixed
mixed
mixed
arrayCustom headings to use
stringto_json(mixed $data, bool $pretty) : string
mixed
boolwhether to make the json pretty
stringto_jsonp(mixed $data, bool $pretty, string $callback) : string
mixed
boolwhether to make the json pretty
stringJSONP callback
stringformatted JSONPto_php(mixed $data) : string
mixed
stringto_serialized(mixed $data) : string
mixed
stringto_xml(mixed $data, null $structure, null | string $basenode, null | bool $use_cdata, mixed $bool_representation) : string
mixed
null
nullstring
nullboolwhether to use CDATA in nodes
mixedif true, element values are true/false. if 1, 1/0.
stringto_yaml(mixed $data) : string
mixed
string_from_csv(string $string, bool $no_headings) : array
string
bool
array_from_xml(string $string, bool $recursive) : array
string
bool
array_from_yaml(string $string) : array
string
arraypretty_json(string $data) : string | false
Borrowed from http://www.php.net/manual/en/function.json-encode.php#80339
stringjson encoded array
stringfalsepretty json output or false when the input was not valid_from_json(string $string) : mixed
string
mixed_from_serialize(string $string) : mixed
string
mixed$_data : array | mixed
$ignore_namespaces : bool