ARouter  0.1.0
Annotation based router for your projects
HTTP Message Converters

We can define our own HTTP message converters by implementing HttpMessageConverterInterface. Then we can pass our converters as argument to RouterFactory::getRouter() .

The goal of the converter is to convert object/scalar value to HTTP response object. This way we can return objects in controller methods and they will be automatically converted to Response objects.

For example if we create JsonHttpMessageConverter then in theory we will have possibility to return object/arrays from our controller

public function getData(){
return ['name' => 'Name', 'lastname' => 'Lastname'];
}

and this array will be converted to JSON response with body

{name: 'Name', lastname: 'Lastname'}