Skip to content

Commit 99e76b7

Browse files
authored
Merge pull request #1 from codeinchq/v1.0
first version
2 parents ed22dfa + c7252b4 commit 99e76b7

File tree

5 files changed

+3416
-2
lines changed

5 files changed

+3416
-2
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/vendor
2+
/.idea

README.md

+37-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,37 @@
1-
# symfony-phpspreadsheet-response
2-
A Symfony HTTP response for PhpSpreadsheet
1+
# Symfony PhpSpreadsheet HTTP response
2+
3+
A simple Symfony HTTP response for PhpSpreadsheet written in PHP 8 intended to the used with Symfony's
4+
[HTTPFoundation component](https://symfony.com/components/HttpFoundation).
5+
6+
## Usage
7+
8+
```php
9+
<?php
10+
use CodeInc\SpreadsheetResponse\SpreadsheetResponse;
11+
use PhpOffice\PhpSpreadsheet\Spreadsheet;
12+
use Symfony\Component\HttpFoundation\Response;
13+
14+
class MyController extends AbstractController {
15+
/**
16+
* @Route("/a-spreadsheet", name="download_a_spreadsheet")
17+
*/
18+
public function downloadASpreadsheet(): Response {
19+
$spreadsheet = new Spreadsheet();
20+
// building the spreadsheet...
21+
return new SpreadsheetResponse($spreadsheet, "My spreadsheet.xlsx");
22+
}
23+
}
24+
```
25+
26+
27+
## Installation
28+
This library is available through [Packagist](https://packagist.org/packages/codeinc/symfony-phpspreadsheet-response) and can be installed using [Composer](https://getcomposer.org/):
29+
30+
```bash
31+
composer require codeinc/symfony-phpspreadsheet-response
32+
```
33+
34+
35+
## License
36+
This library is published under the MIT license (see the [LICENSE](LICENSE) file).
37+

composer.json

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"name": "codeinc/symfony-phpspreadsheet-response",
3+
"version": "1.0.0-beta.1",
4+
"description": "A simple Symfony HTTP response for PhpSpreadsheet written in PHP 8.",
5+
"homepage": "https://github.com/codeinchq/symfony-phpspreadsheet-response",
6+
"type": "library",
7+
"license": "MIT",
8+
"require": {
9+
"php": ">=8.0",
10+
"symfony/http-foundation": "^5.2",
11+
"phpoffice/phpspreadsheet": "^1.16",
12+
"jbroadway/urlify": "^1.2"
13+
},
14+
"autoload": {
15+
"psr-4": {
16+
"CodeInc\\SpreadsheetResponse\\": "src/"
17+
}
18+
},
19+
"autoload-dev": {
20+
"psr-4": {
21+
"CodeInc\\SpreadsheetResponse\\Tests\\": "tests/"
22+
}
23+
},
24+
"authors": [
25+
{
26+
"name": "Joan Fabrégat",
27+
"email": "[email protected]",
28+
"homepage": "https://www.codeinc.co",
29+
"role": "developer"
30+
}
31+
],
32+
"require-dev": {
33+
"phpunit/phpunit": "^9"
34+
}
35+
}

0 commit comments

Comments
 (0)