Untitled
raw download clone
PHP
views 17
,
size 956 b
if ($formFilter->get('export')->isClicked()) {
            $sort = ($request->get('sort')) ? $request->get('sort') : false;
            $dir = ($request->get('direction')) ? $request->get('direction') : false;
            $data = $ur->findAllWithFilters($formFilter->getData(), $sort, $dir)->getResult();

            return $this->export('member', $data);
}




	$response = new StreamedResponse();
        $objWriter = new Xls($spreadsheet);
        $response->setCallback(
            function () use ($objWriter) {
                $objWriter->save('php://output');
            }
        );

        $disposition = $response->headers->makeDisposition(
            ResponseHeaderBag::DISPOSITION_ATTACHMENT,
            'Book-of-Members.xls'
        );

        $response->headers->set('Content-Disposition', $disposition);
        $response->headers->set('Content-Type', 'application/vnd.ms-excel');

        return $response;
close fullscreen
Login or Register to edit or fork this paste. It's free.