codeinc / symfony-phpspreadsheet-response
A simple Symfony HTTP response for PhpSpreadsheet written in PHP 8.
Installs: 10 662
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: >=8.0
- phpoffice/phpspreadsheet: ^1.29|^2.0
- symfony/http-foundation: ^6.0|^7.0
Requires (Dev)
- phpunit/phpunit: ^9
README
A simple Symfony HTTP response for PhpSpreadsheet written in PHP 8 intended to the used with Symfony's HTTPFoundation component.
Usage
<?php use CodeInc\SpreadsheetResponse\SpreadsheetResponse; use PhpOffice\PhpSpreadsheet\Spreadsheet; use Symfony\Component\HttpFoundation\Response; class MyController extends AbstractController { #[Route("/a-spreadsheet", name: "download_a_spreadsheet")] public function downloadASpreadsheet(): Response { $spreadsheet = new Spreadsheet(); // building the spreadsheet... return new SpreadsheetResponse($spreadsheet, "A spreadsheet.xlsx"); } }
Installation
This library is available through Packagist and can be installed using Composer:
composer require codeinc/symfony-phpspreadsheet-response
License
This library is published under the MIT license (see the LICENSE file).