Ejemplo n.º 1
0
 /**
  * Список книг.
  *
  * @return string
  */
 public function actionIndex()
 {
     $modelBook = new Book();
     $dataProvider = $modelBook->search(Yii::$app->request->get());
     $authorIds = Yii::$app->request->get('authors', []);
     $tagIds = Yii::$app->request->get('tags', []);
     Book::applyFilterForRelatedData($dataProvider->query, $tagIds, $authorIds);
     return $this->render('index', ['modelBook' => $modelBook, 'dataProvider' => $dataProvider, 'authorIds' => $authorIds, 'tagIds' => $tagIds]);
 }
Ejemplo n.º 2
0
 public function actionIndex()
 {
     $filterModel = new Book();
     if (Yii::$app->request->get('Book')) {
         $filterModel->load(Yii::$app->request->get());
     }
     $getArray = Yii::$app->request->get();
     $getArray['Book'] = $filterModel->getArrayForLink();
     $this->_registerJs();
     return $this->render('index', ['dataProvider' => $filterModel->search(), 'filterModel' => $filterModel, 'authors' => Author::find()->all(), 'getArray' => $getArray]);
 }
Ejemplo n.º 3
0
 private function renderList()
 {
     $model = new Book();
     $searchParams = Yii::$app->request->get('Book');
     if ($searchParams) {
         $model->setAttributes($searchParams, false);
         $model->dateFrom = $searchParams['dateFrom'];
         $model->dateTo = $searchParams['dateTo'];
     }
     $provider = $model->search();
     return $this->render('index', ['provider' => $provider, 'model' => $model]);
 }
Ejemplo n.º 4
0
 /**
  * Главная страница админки.
  *
  * @return string
  */
 public function actionIndex()
 {
     $modelBook = new Book();
     $dataProvider = $modelBook->search(Yii::$app->request->get());
     return $this->render('/back/book/index', ['modelBook' => $modelBook, 'dataProvider' => $dataProvider]);
 }