source: spip-zone/_squelettes_/soyezcreateurs_net/trunk/plugins/soyezcreateurs/comptetraduction_export_fonctions.php @ 112447

Last change on this file since 112447 was 112447, checked in by real3t@…, 6 months ago

Pouvoir exporter les articles à traduire dans un tableau Excel

File size: 510 bytes
Line 
1<?php
2
3require_once find_in_path('lib/Spout/Autoloader/autoload.php');
4       
5use Box\Spout\Writer\WriterFactory;
6use Box\Spout\Common\Type;
7
8function trad_export_csv($trads) {
9
10        $entetes = array(
11                'ID',
12                'Nom',
13                'URL',
14                'Contenu'
15        );
16       
17        $writer = WriterFactory::create(Type::XLSX); // for XLSX files
18
19        $writer->openToBrowser('traduction'); // stream data directly to the browser
20
21        $writer->addRow($entetes); // add a row at a time
22        $writer->addRows($trads); // add multiple rows at a time
23
24        $writer->close();
25}
Note: See TracBrowser for help on using the repository browser.