omines / datatables-bundle

DataTables bundle for Symfony
https://omines.github.io/datatables-bundle/
MIT License
251 stars 113 forks source link

Exporter should set MIME type #316

Closed gmta closed 7 months ago

gmta commented 8 months ago

In the BinaryFileResponse for an export, the MIME type should be set here if the exporter is able to provide it (which is usually the case): https://github.com/omines/datatables-bundle/blob/01cec9a8ff2bbd92384b1210d5cb8b5c21aceef5/src/Exporter/DataTableExporterManager.php#L65-L77

This allows applications to skip MIME detection and enables running without the optional symfony/mime package.

curry684 commented 8 months ago

PR welcome, I made a point of not touching the export code myself 😆

gmta commented 8 months ago

@curry684 should be easy enough, but the nicest solution (adding a method to the exporters) would require a backwards incompatible change to DataTableExporterInterface since it is a public interface.

Would this be OK or is there another approach you'd prefer?

curry684 commented 8 months ago

Given that 0.8 is already severely breaking and in RC since this week I'm fine with a BC break (https://github.com/omines/datatables-bundle/releases/tag/0.8.0-rc.1)

curry684 commented 7 months ago

Any progress?