Max F %!s(int64=5) %!d(string=hai) anos
pai
achega
8cb2d7bafa
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      helpers/helpers_array.php

+ 3 - 1
helpers/helpers_array.php

@@ -120,6 +120,8 @@ if (! function_exists('get_csv')) {
 
 if (! function_exists('exportToCsvFile')) {
 	function exportToCsvFile($rows, $export_filename=null, $fields=null) {
+		$csv_content = get_csv($rows, $fields);
+		
 		if (! empty($export_filename)) {
 			// download file
 			header('Content-Type: text/csv');
@@ -131,7 +133,7 @@ if (! function_exists('exportToCsvFile')) {
 			header('Content-Type: text/plain');
 		}
 
-		echo get_csv($rows, $fields);
+		echo $csv_content;
 		exit;
 	}
 }