silverstripe/gridfieldqueuedexport
最新稳定版本:4.0.3
Composer 安装命令:
composer require silverstripe/gridfieldqueuedexport
包简介
Export large data sets from your GridField in the SilverStripe CMS interface through async jobs
README 文档
README
Introduction
Allows for large data set exports from a GridField. By using an asynchronous job queue, we avoid
running out of PHP memory or exceeding any maximum execution time limits.
The exact limitations of a standard GridField export vary based on the server configuration,
server capacity and the complexity of the exported DataObject.
As a rough guide, you should consider using this module
when more than 1000 records need to be exported. The module should be able to export
10,000 records on a standard server configuration within a few minutes.
Installation
composer require silverstripe/gridfieldqueuedexport
Configuration
Since this component operates on a GridField, you can simply use it's addComponent() API.
$gridField = GridField::create('Pages', 'All pages', SiteTree::get()) $config = $gridField->getConfig(); $config->addComponent(GridFieldQueuedExportButton::create('buttons-after-left'));
If you want to replace the GridFieldExportButton created by the default GridField configuration,
you also need to call removeComponentsByType().
// Find GridField $gridField = $fields->fieldByName('MyGridField'); $config = $gridField->getConfig(); // Add new component $oldExportButton = $config->getComponentByType(GridFieldExportButton::class); $config->addComponent($newExportButton = GridFieldQueuedExportButton::create('buttons-after-left')); // Set Header and Export columns on new Export Button $newExportButton->setCsvHasHeader($oldExportButton->getCsvHasHeader()); $newExportButton->setExportColumns($oldExportButton->getExportColumns()); // Remove original component $config->removeComponentsByType(GridFieldExportButton::class);
Note: This module is preconfigured to work with the silverstripe/userforms submission CSV export.
Related
- silverstripe/queuedjobcsvexport: General purpose CSV exports through queuedjobs (without a dependency on GridField)
统计信息
- 总下载量: 205.44k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 10
- 点击次数: 1
- 依赖项目数: 5
- 推荐数: 7
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2016-05-23