[ 'class' => AccessControl::className(), 'rules' => [ [ 'actions' => ['index', 'view'], 'allow' => true, 'roles' => ['@'], ], ], ], // 'verbs' => [ // 'class' => VerbFilter::className(), // 'actions' => [ // 'logout' => ['post'], // ], // ], ]; } /** * @inheritdoc */ public function actions() { return [ 'error' => [ 'class' => 'yii\web\ErrorAction', ], ]; } public function actionIndex() { if(Yii::$app->request->isAjax){ CustomVarDamp::dumpAndDie(1); } //$query = (new Query())->select('*')->from('{{%importer_files}}')->where(['not', ['time_end' => null]])->orderBy(['upload_time' => SORT_DESC]); $query = Importer::find()->where(['active' => true])->orderBy(['price_date_update' => SORT_DESC]); $provider = new ActiveDataProvider([ 'query' => $query, 'pagination' => [ 'pageSize' => 10, ], ]); return $this->render('index', [ 'dataProvider' => $provider, ]); } public function actionView ($id) { $query = Details::find()->where(['IMPORT_ID' => $id])->orderBy(['timestamp' => SORT_DESC]); $provider = new ActiveDataProvider([ 'query' => $query, 'pagination' => [ 'pageSize' => 16, ], ]); return $this->render('view', ['dataProvider' => $provider]); } }