Merge pull request #6983 from JustinTBrown/patch-1

Update to 00_CSV_Import.md
This commit is contained in:
Daniel Hensby 2017-05-31 19:17:33 +01:00 committed by GitHub
commit bf8d4252e3

View File

@ -194,6 +194,22 @@ Sample implementation of a custom loader. Assumes a CSV-file in a certain format
}
}
?>
Building off of the ModelAdmin example up top, use a custom loader instead of the default loader by adding it to `$model_importers`. In this example, `CsvBulkLoader` is replaced with `PlayerCsvBulkLoader`.
:::php
<?php
class PlayerAdmin extends ModelAdmin {
private static $managed_models = array(
'Player'
);
private static $model_importers = array(
'Player' => 'PlayerCsvBulkLoader',
);
private static $url_segment = 'players';
}
?>
## Related