should be a simple fix but I'm not exactly sure why my LinkPager
isn't showing here. My controller action is:
public function actionIndex()
{
$query = Shout::find()->orderBy(['id' => SORT_DESC]);
$countQuery = count($query);
$pagination = new Pagination(
[
'totalCount' => $countQuery,
'pageSize' => 5
]
);
$shouts = $query->offset($pagination->offset)
->limit($pagination->limit)
->all();
return $this->render(
'index',
[
'shouts' => $shouts,
'pagination' => $pagination
]
);
}
And my LinkPager widget is:
use yii\widgets\LinkPager;
echo LinkPager::widget(
[
'pagination' => $pagination
]
);
And while the pageSize
is being limited to 5
, I do not see the page selection below. Any help would be appreciated.