我从网站下载excel文件时遇到问题。我用kartik \ export \ ExportMenu;我在脚本中加入了这个视图:
<?php
ini_set('max_execution_time', 300); //300 seconds = 5 minutes
$gridColumns = [
'order_number',
[
但它没有帮助。我怎么能修好它?
public function actionIndex()
{
$searchModel = new OrderSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
return $this->render('index', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
]);
}
答案 0 :(得分:1)
有三种配置可以帮助以防超时但不能保证。
在ExportMenu
窗口小部件配置中设置的选项:
'stream' => false
'stream' => false, // this will automatically save the file to a folder on web server
'streamAfterSave' => true, // this will stream the file to browser after its saved on the web folder
'deleteAfterSave' => true, // this will delete the saved web file after it is streamed to browser,
'target' => '_blank',
'batchSize' => 10,
'target' => '_blank',
答案 1 :(得分:0)
尝试增加max_execution_time
<?php
ini_set('max_execution_time', 3600); //3600 seconds = 60 minutes
$gridColumns = [
'order_number',
[