lithium\net\http\Media::decode()

public static method

For media types registered in $_handlers which include an 'decode' setting, decodes data according to the specified media type.

Parameters

  • string $type

    Specifies the media type into which $data will be encoded. This media type must have an 'encode' setting specified in Media::$_handlers.

  • mixed $data

    Arbitrary data you wish to encode. Note that some encoders can only handle arrays or objects.

  • array $options

    Handler-specific options.

Returns

mixed

Source

	public static function decode($type, $data, array $options = array()) {
		if ((!$handler = static::handlers($type)) || empty($handler['decode'])) {
			return null;
		}
		$method = $handler['decode'];
		return is_string($method) ? $method($data) : $method($data, $handler + $options);
	}