浏览代码

debut export CSV

v1
Charly 3 年前
父节点
当前提交
d344075bcd
共有 1 个文件被更改,包括 22 次插入12 次删除
  1. +22
    -12
      src/Controller/Frontend/CartoController.php

+ 22
- 12
src/Controller/Frontend/CartoController.php 查看文件

@@ -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();
}
}

正在加载...
取消
保存