What would be the right way of getting CSV as a file download, prepared from a database table. I would like this to happen on a button click.
Should I first make that .csv
using standard way of doing it in PHP, then use \Web::instance()->send()
in some route handler?
Web->send
expects a real file as input, so you'll have to go the standard PHP way:Also checkout ikkez's
Sheet
class, which may help you rendering tabular data in Excel and CSV format.