Content-Negotiation with the help of Renderer and Formatters

This commit is contained in:
Gilles Crettenand
2015-06-02 02:02:40 +02:00
parent c0159f4b79
commit 7e0a38e989
7 changed files with 241 additions and 23 deletions

13
Lib/Formatter/Text.php Normal file
View File

@@ -0,0 +1,13 @@
<?php
namespace BSR\Lib\Formatter;
class Text extends Formatter {
protected static function init() {
self::registerFormats(array('text/plain'));
}
public function render($data) {
print_r($data);
}
}