-
Notifications
You must be signed in to change notification settings - Fork 0
The CSV view
The Csv view class FOF30\View\DataView\Csv
is designed to create data-aware Views which result in downloadable CSV files.
CSV files are a standard and very convenient way of exporting data for use in third party applications and systems such as Microsoft Office Excel, OpenOffice / LibreOffice Calc or even import data in third party databases.
This View class is simply an extension to the Raw view class. Everything described in the Raw view class still applies here. The Csv class adds a few features on top of what Raw can already do.
The $config
configuration array to the class can contain the following parameters:
-
csv_header Should I add a CSV header (list of fields)? Default true. You can also pass the URL parameter
csv_header=1
andcsv_header=0
to toggle this. -
csv_filename The filename which will appear in the browser's Save As dialog box. Defaults to the name of the view. You can also pass it in the URL parameter
csv_filename=something.csv
- csv_fields An array of fields which should be included in the CSV output. Leave it empty to include all fields known to the DataModel.
The generated CSV is in a format compatible with Microsoft Office Excel, supported by virtually every other software which claims CSV compatibility.
FOF (Framework on Framework) and its documentation are Copyright © 2010-2020 Nicholas K. Dionysopoulos / Akeeba Ltd.
FOF is Open Source Software, distributed under the GNU General Public License, version 2 of the license, or (at your option) any later version.
The FOF Wiki content is provided under the GNU Free Documentation License, version 1.3 of the license, or (at your option) any later version.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license can be found on the GNU site.