Esempio n. 1
0
 public function run()
 {
     $searchModel = new ItemSearch();
     $dataProvider = $searchModel->search(['model_name' => get_class($this->model), 'model_id' => $this->model->primaryKey], '');
     $dataProvider->sort = false;
     $dataProvider->query->orderBy(['created_at' => SORT_DESC]);
     return $this->render($this->viewFile, compact('dataProvider'));
 }
Esempio n. 2
0
 /**
  * Lists all Item models.
  * @return mixed
  */
 public function actionIndex()
 {
     $searchModel = new ItemSearch();
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
 }