Ejemplo n.º 1
0
 public function renderResponse($data = null)
 {
     $response = $this->renderer->renderResponse($data);
     $method = strtoupper($this->getRequest()->getMethod());
     if (true === array_key_exists($method, $this->codes)) {
         $statusCode = $this->codes[$method];
         $statusCode = null === $data && Response::HTTP_OK === $statusCode ? Response::HTTP_NO_CONTENT : $statusCode;
         $response->setStatusCode($statusCode, Response::$statusTexts[$statusCode]);
     }
     return $response;
 }
Ejemplo n.º 2
0
 public function addRenderer(Renderer $renderer)
 {
     $this->renderers[$renderer->getName()] = $renderer;
 }