I have an export menu like this
<?php // Export menu
$menuExport = ExportMenu::widget([
'dataProvider' => $dataProvider,
'columns' => $gridColumns,
'filename' => $this->title . '_' . date('Ymd'),
'clearBuffers' => false,
'timeout' => -1,
'target' => ExportMenu::TARGET_BLANK,
'fontAwesome' => true,
'pjaxContainerId' => 'kv-pjax-container',
'hiddenColumns' => [],
'messages' => [
'allowPopups' => $allowPopups,
'confirmDownload' => $confirmDownload,
],
'dropdownOptions' => [
'label' => Yii::t('app', 'Export'),
'class' => 'btn btn-default',
'itemsBefore' => [
'<li class="dropdown-header">' . Yii::t('app', 'Export data') . '</li>',
],
],
'exportConfig' => [],
]);
}
?>
And I would like to use the variable $menuExport in a class
class DownloadJob extends BaseObject implements \yii\queue\JobInterface
which can run in background using yii2-queue, so it doesn’t block anything while running.
I need this because the table could contain even million of rows, and the export process could be very long.
Is this possible?