nateabele/li3_resources — pull request #3 by jails (2013-07-14 16:45:18+00:00)
Title: Use response type instead of request type to set the requireView default value.

When you set a specific type for response, the responder still set the requireView according the request.
So you need to deal with the handler with manage two type of datas.

```php
Media::type($id, $type, [
'cast' => false,
'encode' => function($data) {
/*
//Shouldn't be needed.
if (isset($data['file']) && isset($data['file']->file) && is_object($data['file']->file)) {
return $data['file']->file->getBytes();
}
*/
return (isset($data['file'])) ? $data['file']->getBytes() : null;
},
'decode' => function($file) {
return compact('file');
}
]);
```