src/Charcoal/Admin/Service/Exporter.php
public function export()
    {
        $headers = $this->fileHeaders();
        $rows = $this->rows();

        $writer = Writer::createFromFileObject(new SplTempFileObject());
        $writer->setNewline("\r\n");
        $writer->setOutputBOM(Writer::BOM_UTF8);
        $writer->insertOne($headers);

        foreach ($rows as $r) {
            $writer->insertOne($r);
        }

        $writer->output($this->filename());
    }
public function export()
    {
        $headers = $this->fileHeaders();
        $rows = $this->rows();

        $writer = Writer::createFromFileObject(new SplTempFileObject());
        $writer->setNewline("\r\n");
        $writer->setOutputBOM(Writer::BOM_UTF8);
        $writer->insertOne($headers);

        foreach ($rows as $r) {
            $writer->insertOne($r);
        }

        $writer->output($this->filename());
    }
public function export ( ) { $ headers = $ this -> fileHeaders ( ) ; $ rows = $ this -> rows ( ) ; $ writer = Writer :: createFromFileObject ( new SplTempFileObject ( ) ) ; $ writer -> setNewline ( "\r\n" ) ; $ writer -> setOutputBOM ( Writer :: BOM_UTF8 ) ; $ writer -> insertOne ( $ headers ) ; foreach ( $ rows as $ r ) { $ writer -> insertOne ( $ r ) ; } $ writer -> output ( $ this -> filename ( ) ) ; }
Export to CSV
@return void
Export to CSV