public function sendContent() { if (is_array($this->content) || is_object($this->content)) { $out = fopen('php://output', 'w'); foreach ($this->content as $row) { fputcsv($out, (array) $row); } fclose($out); return $this; } return parent::sendContent(); }