-
Notifications
You must be signed in to change notification settings - Fork 5
Drivers
Patrick Brouwers edited this page May 14, 2015
·
7 revisions
Clerk has a lot of drivers for all different file types. You can easily swap them in the config:
Ledger::set('drivers.{reader/writer}.{type:csv/pdf/..}', '{name});
Ledger::set('drivers.reader.csv', 'SpreadsheetParser');
Ledger::set('drivers.writer.csv', 'SpreadsheetParser');
If you want to add your own impementation of existing drivers or add a new one, you can register a new driver. This driver should implement Maatwebsite\Clerk\Drivers\DriverInterface
.
class CustomCsvDriver implement DriverInterface
{
// Implement the DriverInterface methods
}
Ledger::register('reader.csv', function() {
return new CustomCsvDriver();
});
The CustomCsvDriver
is now registered and set as default. The system now knows where it can find the custom classes.
Readers
- PHPExcel (default)
- SpreadsheetParser
Writers
- PHPExcel (default)
Readers
- LeagueCsv (default)
- PHPExcel
- SpreadsheetParser
Writers
- LeagueCsv (default)
- PHPExcel
Readers
Writers
- Snappy (default)
Readers
- PHPWord (default)
Writers
- PHPWord (default)