本文整理汇总了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]);
}
示例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]);
}
示例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]);
}
示例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]);
}