| 1 | <?php |
||
| 14 | class StreamedCsvResponse extends StreamedResponse |
||
| 15 | { |
||
| 16 | /** |
||
| 17 | * @var array|\Traversable |
||
| 18 | */ |
||
| 19 | private $rows; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * Constructor. |
||
| 23 | * |
||
| 24 | * @param array|\Traversable $rows An iterable representing the csv rows. |
||
| 25 | * @param string $filename An filename the client downloads. |
||
| 26 | * |
||
| 27 | * @throws \InvalidArgumentException |
||
| 28 | */ |
||
| 29 | 14 | public function __construct($rows, $filename) |
|
| 47 | |||
| 48 | /** |
||
| 49 | * Outputs the result. |
||
| 50 | */ |
||
| 51 | 10 | public function output() |
|
| 61 | } |
||
| 62 |