Exemplo n.º 1
0
 /**
  * Runs the action
  *
  * @return string result content
  */
 public function run($id)
 {
     $model = SchedulerTask::findOne($id);
     $request = Yii::$app->getRequest();
     if (!$model) {
         throw new \yii\web\HttpException(404, 'The requested page does not exist.');
     }
     if ($model->load($request->post())) {
         $model->save();
     }
     $logModel = new SchedulerLog();
     $logModel->scheduler_task_id = $model->id;
     $logDataProvider = $logModel->search($_GET);
     return $this->controller->render($this->view ?: $this->id, ['model' => $model, 'logModel' => $logModel, 'logDataProvider' => $logDataProvider]);
 }