Welcome Guest, Not a member yet? Register   Sign In
Debug Bar getting in the way
#1

I have a controller that among other things downloads a csv file. But my downloaded file contains my data plus the debug bar html code! How do I get rid of this?

PHP Code:
public function download_names($rcseq)
    {
        
$db = new \App\Libraries\NcrsEbnDb();
        
$rows $db->getRCNames($rcseq);
        
header("Content-type: text/csv");
        
header("Content-Disposition: attachment; filename=names-$rcseq.csv");
        
ob_clean();
        
flush();
        foreach (
$rows as $row)
            print 
$row['NAME'] . "\r\n";
    } 
Simpler is always better
Reply


Messages In This Thread
Debug Bar getting in the way - by donpwinston - 08-11-2017, 08:01 AM
RE: Debug Bar getting in the way - by kilishan - 08-11-2017, 11:10 AM
RE: Debug Bar getting in the way - by donpwinston - 08-11-2017, 12:28 PM
RE: Debug Bar getting in the way - by kilishan - 08-11-2017, 12:39 PM
RE: Debug Bar getting in the way - by John_Betong - 08-11-2017, 07:55 PM



Theme © iAndrew 2016 - Forum software by © MyBB