CallbackExporterType
The CallbackExporterType
represents a filter that uses a given callback as its handler.
Options
callback
- type:
callable
Sets callable that works as an exporter handler.
php
use Kreyu\Bundle\DataTableBundle\Exporter\Type\CallbackExporterType;
use Kreyu\Bundle\DataTableBundle\Exporter\ExporterInterface;
use Kreyu\Bundle\DataTableBundle\Exporter\ExportFile;
use Kreyu\Bundle\DataTableBundle\DataTableView;
$builder
->addExporter('txt', CallbackExporterType::class, [
'callback' => function (DataTableView $view, ExporterInterface $exporter, string $filename): ExportFile {
// ...
},
])
;
Inherited options
use_headers
- type:
bool
- default:
true
Determines whether the exporter should add headers to the output file.
label
- type:
null
orstring
- default:
null
the label is "guessed" from the exporter name
Sets the label of the exporter, visible in the export action modal.
tempnam_dir
- type:
string
- default: the value returned by the
sys_get_temp_dir()
function
Sets the directory used to store temporary file during the export process.
tempnam_prefix
- type:
string
- default:
exporter_
Sets the prefix used to generate temporary file names during the export process.