Answer the question
In order to leave comments, you need to log in
How to correctly specify routes in the pager?
Hello everyone, I ran into a problem, there is a regular page with pagination
$query = FalseBase::find()->where(['status' => 1])->orderBy(['id' => SORT_DESC]);
$pages = new Pagination([
'totalCount' => $query->count(), 'pageSize' => 6,
'forcePageParam' => false, 'pageSizeParam' => false,
'route' => 'admin/false-filter/index'
]);
$falsers = $query->offset($pages->offset)->limit($pages->limit)->all();
return $this->render('index',compact('falsers','pages'));
public function actionDelete($id)
{
$model = $this->findModel($id);
//Если модель удаленна
if ($model->delete()) {
//Удалим ее картинки
$deleter = new ImageDeleter;
$deleter->deleteImg($id, 'False');
}
//Запрос обновленного списка кидал
$query = FalseBase::find()->with('phones')->with('addresses')->with('photo')->where(['status' => [1,2]])->orderBy(['id' => SORT_DESC]);
//Пейджер
$pages = new Pagination([
'totalCount' => $query->count(), 'pageSize' => 6,
'forcePageParam' => false, 'pageSizeParam' => false,
'route' => 'admin/false/index'
]);
$falsers = $query->offset($pages->offset)->limit($pages->limit)->all();
return $this->renderAjax('index', compact('falsers','pages'));
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question