Browse Source

debut export CSV

v1
Charly 3 years ago
parent
commit
d344075bcd
1 changed files with 22 additions and 12 deletions
  1. +22
    -12
      src/Controller/Frontend/CartoController.php

+ 22
- 12
src/Controller/Frontend/CartoController.php View File

@@ -2,12 +2,6 @@

namespace App\Controller\Frontend;

use App\Entity\Dream;
use App\Entity\ProjectBoost;
use App\Entity\ProjectInspiring;
use App\Entity\Revolt;
use App\Form\ContactForm;
use App\Form\IndividualForm;
use App\Form\SearchListForm;
use App\Repository\DreamStore;
use App\Repository\ProjectBoostStore;
@@ -15,12 +9,7 @@ use App\Repository\ProjectInspiringStore;
use App\Repository\RevoltStore;
use Doctrine\ORM\EntityManagerInterface;
use Knp\Component\Pager\PaginatorInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Response;
use App\Entity\Site\Page;
use Symfony\Component\Mailer\MailerInterface;
use Symfony\Component\Mime\Email;
use Lc\SovBundle\Generator\CsvGenerator;
use Symfony\Component\HttpFoundation\Request;

class CartoController extends DefaultController
@@ -123,4 +112,25 @@ class CartoController extends DefaultController
);
}

public function exportListCsv()
{
$csv = new CsvGenerator();
$csv->enableConvertEncoding('ISO-8859-1');
$csv->setTitle('Export_Liste', true);

$columns = [
'category' => 'Catégorie',
'thematic' => 'Thématique',
'subthematic' => 'Contribution',
'territory' => 'Lieu'
];
$csv->setColumns($columns);

$data = [

];
$csv->row($data);

return $csv->getReponse();
}
}

Loading…
Cancel
Save