lithium\net\http\Media::to()
Alias for encode(); included for interface compatibility with
lithium\util\Collection::to(), which allows a collection object to be exported to any
format supported by a Media handler. See the documentation for Collection::to() for more
information.
Parameters
-
mixed
$formatFormat into which data will be converted, i.e.
'json'. -
mixed
$dataEither an array or object (usually an instance of
Collection) which will be converted into the specified format. -
array
$optionsAdditional handler-specific options to pass to the content handler.
Returns
mixedSource
public static function to($format, $data, array $options = []) {
return static::encode($format, $data, $options);
}