title: csv export file
body: <p>I want to export data as CSV file.
  This is my test function </p>
  
  <pre><code>    private function exportToCSV()
  {         
        $titles = array('one', 'two', 'three');
        $delimiter = ',';
  
        $filename = 'simple.csv';
        header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
        header('Content-Description: File Transfer');
        header("Content-type: text/csv");
        header("Content-Disposition: attachment; filename={$filename}");
        header("Expires: 0");
        header("Pragma: public");
  
  
        $file = @fopen( 'php://output', 'w' );
  
        fwrite($file, implode($delimiter, $titles) . "\r\n");
  
        fclose($file);     
  }
  </code></pre>
  
  <p>I run this function inside a module and I'm getting csv file with titles but whole page as well. How to get only csv file with titles only ?</p>