Selaa lähdekoodia

update exporter

jqh 5 vuotta sitten
vanhempi
commit
d040f9d35a
1 muutettua tiedostoa jossa 9 lisäystä ja 4 poistoa
  1. 9 4
      src/Grid/Exporters/ExcelExporter.php

+ 9 - 4
src/Grid/Exporters/ExcelExporter.php

@@ -7,15 +7,20 @@ use Dcat\Admin\Grid;
 
 class ExcelExporter extends AbstractExporter
 {
-    /**
-     * {@inheritdoc}
-     */
-    public function export()
+    public function __construct($titles = [])
     {
+        parent::__construct($titles);
+
         if (! class_exists(Excel::class)) {
             throw new \Exception('To use exporter, please install [dcat/easy-excel] first.');
         }
+    }
 
+    /**
+     * {@inheritdoc}
+     */
+    public function export()
+    {
         $filename = $this->getFilename().'.'.$this->extension;
 
         $exporter = Excel::export();