O'Reilly logo

CMS Made Simple Development Cookbook by Samuel Goldstein

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Outputting a downloadable CSV file from your module

If your module handles a lot of structured data, you will eventually get the requirement to generate reports on that data (particularly if the data is user-entered). There are several tacks you could take to meet this requirement. You could write code with elaborate calculations and various graphing libraries to present fancy reports, or, alternatively, you could give your site users the ability to export the data to a spreadsheet or other tool that's designed specifically for processing data and making reports.

As is obvious from the title of this chapter, this recipe is a demonstration of the latter approach. We export some sample data in Comma Separated Value (CSV) format, that is recognized ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required