changed directory structure to match namespace

This commit is contained in:
Guillermo Dev
2018-10-11 11:43:51 +02:00
parent 6efc6a95ad
commit 369f6c003a
13 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
<?php
namespace BSR\Webservice;
use BSR\Webservice\Formatter\Formatter;
class Renderer {
private static $statusMessages = array(
200 => 'Ok',
400 => 'Bad request',
404 => 'Not Found',
403 => 'Not Authorized',
500 => 'Server Error',
);
public function __construct() {
ob_start();
}
public function render($status, $data) {
header(sprintf('HTTP/1.0 %s %s', $status, self::$statusMessages[$status]));
header("Access-Control-Allow-Origin: *");
ob_clean();
flush();
$formatter = Formatter::getFormatter();
$formatter->render($data);
}
}