My pagination does not show on my index page.
Can someone tell me how to create pagination for my index page with a limit of 15?
public function actionIndex()
{
$searchModel = new EmployeeSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
$pagination = new Pagination([
'defaultPageSize' => 5,
'totalCount' =>$this->count(),
]);
$employee = $query->orderBy('name')
->offset($pagination->offset)
->limit($pagination->limit)
->all();
return $this->render('index', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
'Employee-create' => $employee,
'pagination' => $pagination,
]);
}