Explorar o código

update exporter

jqh %!s(int64=5) %!d(string=hai) anos
pai
achega
d040f9d35a
Modificáronse 1 ficheiros con 9 adicións e 4 borrados
  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();