Exemplo n.º 1
0
 public static function loader()
 {
     $model = new VLoader();
     $query = $model->find();
     $provider = new ActiveDataProvider(['query' => $query]);
     return $provider;
 }
Exemplo n.º 2
0
 public function actionLoader()
 {
     $provider = VLoader::loader();
     $model = new UploadForm();
     $text = '';
     if (\Yii::$app->request->isPost) {
         $model->textFile = UploadedFile::getInstance($model, 'textFile');
         if ($model->upload()) {
             $text = $model->getSql();
         }
     }
     return $this->render('loader', ['provider' => $provider, 'model' => $model, 'text' => $text]);
 }