當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Book::search方法代碼示例

本文整理匯總了PHP中app\models\Book::search方法的典型用法代碼示例。如果您正苦於以下問題:PHP Book::search方法的具體用法?PHP Book::search怎麽用?PHP Book::search使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在app\models\Book的用法示例。


在下文中一共展示了Book::search方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: actionIndex

 /**
  * Список книг.
  *
  * @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]);
 }
開發者ID:Rey8d01,項目名稱:book-catalog,代碼行數:14,代碼來源:FrontController.php

示例2: actionIndex

 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]);
 }
開發者ID:k666r,項目名稱:test_yii2,代碼行數:11,代碼來源:BooksController.php

示例3: renderList

 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]);
 }
開發者ID:virtyos,項目名稱:books_manager,代碼行數:12,代碼來源:SiteController.php

示例4: actionIndex

 /**
  * Главная страница админки.
  *
  * @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]);
 }
開發者ID:Rey8d01,項目名稱:book-catalog,代碼行數:11,代碼來源:BackBookController.php


注:本文中的app\models\Book::search方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。