mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #6983 from JustinTBrown/patch-1
Update to 00_CSV_Import.md
This commit is contained in:
commit
bf8d4252e3
@ -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
|
## Related
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user