If you want to export the data in the database as a CSV file in symfony, try the following:
The code is as follows:
Public function executeRegistrantsToCsv (){
$ Id = $ this-> getRequestParameter ('id ');
$ C = new Criteria ();
$ C-> add (RegistrantPeer: EVENT_ID, $ id );
$ C-> add (RegistrantPeer: STATUS, 1 );
$ This-> aObjReg = RegistrantPeer: doSelect ($ c );
In the template registrantsToCsvSuccess. php:
The code is as follows:
Title, Name, Email, Phone, Organisation, State, City, Country, Login Date, IpAddress
In the templates/csv. php:
GetRaw ('SF _ content')?>
From: http://blog.baddog.net.au/sonius/steve-sonius/how-to-export-data-as-a-csv-file-in-symfony/
If it doesn't work, try this: http://blog.baddog.net.au/sonius/steve-sonius/how-to-export-data-as-an-xls-or-csv-file-from-the-admin-generator-in-symfony-1-4/
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.