예제 #1
0
 /**
  * Create the XML based on the locale items.
  */
 public function getContent()
 {
     $charset = BackendModel::getContainer()->getParameter('kernel.charset');
     // create XML
     $xmlOutput = BackendLocaleModel::createXMLForExport($this->locale);
     return new Response($xmlOutput, Response::HTTP_OK, ['Content-Disposition' => 'attachment; filename="locale_' . BackendModel::getUTCDate('d-m-Y') . '.xml"', 'Content-Type' => 'application/octet-stream;charset=' . $charset, 'Content-Length' => '' . mb_strlen($xmlOutput)]);
 }
예제 #2
0
 /**
  * Create the XML based on the locale items.
  */
 private function createXML()
 {
     $charset = BackendModel::getContainer()->getParameter('kernel.charset');
     // create XML
     $xmlOutput = BackendLocaleModel::createXMLForExport($this->locale);
     // xml headers
     header('Content-Disposition: attachment; filename="locale_' . BackendModel::getUTCDate('d-m-Y') . '.xml"');
     header('Content-Type: application/octet-stream;charset=' . $charset);
     header('Content-Length: ' . strlen($xmlOutput));
     // output XML
     echo $xmlOutput;
     exit;
 }