[ 'class' => VerbFilter::className(), 'actions' => [ 'view' => [ 'POST' ], ], ], ]; } public function actionIndex(){ // $model=new DynamicModel(['timeFrom','timeTo']); // $model->addRule(['timeFrom','timeTo'],'string'); $model=new DateModel(); return $this->render('index',[ 'model' => $model ]); } public function actionView(){ $model=new DateModel(); $model->load(Yii::$app->request->post()); $controller=new PdfController('pdf',Yii::$app); $a=$controller->runAction('view',[ $model ]); $exportInfo = json_decode($a); if($exportInfo->status==false){ # выдать что данных нету return $this->render('index',[ 'status' => false, 'model' => $model, 'reason' => $exportInfo->reason, ]); } else{ return Yii::$app->response->sendFile("../../frontend/web/files/xls/".$exportInfo->file); } } }