zf-fr/ZfrRest — pull request #26 by bakura10 (2013-01-27 15:09:25+00:00)
Title: Initial commit of doc

Hi,

This is some boring stuff. I thought it would help us to see how everything would work together by beginning to write the doc.

Btw, when writing the doc I realized that it was not really convenient to add new decoders/encoders/models. So I added those to the service listener, so now we can add, for instance, a new decoder the following way (or by implementing DecoderProviderInterface like any other ZF 2 plugin manager):

```php
return array(
'decoders' => array(
'invokables' => array(
'application/x-special-json' => 'Symfony\Serializer\Encoder\JsonDecode'
)
)
);
```

This way, we'll have "generic" decoders/encoders specified directly in the DecoderPluginManager, while specialiezd encoders/decoders will be specified in the resource metadata.

Similarly, you can add new mime-type => model mapping using the models key:

```php
return array(
'models' => array(
'invokables' => array(
'application/x-special-json' => 'Zend\View\Model\JsonModel'
)
)
);
```