/** * 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; }
/** * @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 . '"']); }