createTemplateXmlForExport() public static method

Create template XML for export
public static createTemplateXmlForExport ( string $theme ) : string
$theme string
return string
 /**
  * Export the templates as XML.
  */
 protected function parse()
 {
     $xml = Model::createTemplateXmlForExport($this->selectedTheme);
     $filename = 'templates_' . BackendModel::getUTCDate('d-m-Y') . '.xml';
     header('Content-type: text/xml');
     header('Content-disposition: attachment; filename="' . $filename . '"');
     echo $xml;
     exit;
 }
Example #2
0
 /**
  * @return Response
  */
 public function getContent()
 {
     $filename = 'templates_' . BackendModel::getUTCDate('d-m-Y') . '.xml';
     return new Response(Model::createTemplateXmlForExport($this->selectedTheme), Response::HTTP_OK, ['Content-type' => 'text/xml', 'Content-disposition' => 'attachment; filename="' . $filename . '"']);
 }