Esempio n. 1
0
 /**
  * Serializes the response data in xml format.
  *
  * @param array $data
  *   The data to serialize
  *
  * @return \Symfony\Component\HttpFoundation\Response
  *   The response for chaining.
  */
 protected function serializeResponseData($data, $code = Response::HTTP_OK)
 {
     $output = $this->serializer->serialize($data, 'xml');
     $response = new Response($output, $code);
     $response->headers->set('Content-Type', 'application/xml; charset=utf-8');
     return $response;
 }