Browse Source

updated export to create folder

Jean Sumara 5 years ago
parent
commit
c07e666285
1 changed files with 4 additions and 0 deletions
  1. 4 0
      src/App/Factory/ExportFactory.php

+ 4 - 0
src/App/Factory/ExportFactory.php

@@ -11,6 +11,10 @@ use Flowdat\Export\App\Exporter\ExporterXml;
 class ExportFactory
 {
     public static function create($type, $fileName, $data, $header){
+        if (!file_exists(__DIR__.'/../../Resource/')) {
+            mkdir(__DIR__.'/../../Resource/', 0777, true);
+        }
+
         switch ($type){
             case 'xls':
             case 'csv':