public static function doExport() { self::$exportFile = self::getExportFilePath(); $routeList = new Staticroute_List(); $routeList->load(); $routesCollection = $routeList->getRoutes(); self::openExportFile(); array_walk($routesCollection, 'PimPon_Routes_Export::exportRoute'); self::closeExportFile(); return self::$exportFile; }
public function exportAction() { try { $exportFile = PimPon_Routes_Export::doExport(); ob_end_clean(); header("Content-type: application/json"); header("Content-Disposition: attachment; filename=\"pimponexport.routes.json\""); echo file_get_contents($exportFile); exit; } catch (Exception $ex) { Logger::err($ex->getMessage()); $this->_helper->json(array("success" => false, "data" => 'error'), false); } }