Yii2 LinkPager CAP
How do you build a LinkPager? The rule.
[ 'pattern' => 'news/<page:\d+>', 'route' => '/news/index' ],
$pages = new Pagination([ 'route' => 'news/', 'totalCount' => $countQuery->count(), 'pageSize' => self::PAGE_SIZE, 'forcePageParam' => false, 'pageSizeParam' => false, ]);
Still, LinkPager Generates the reference to the species
Reference to type
What am I doing?
carriann last edited by
Route means "controller/action," not url. It's by the matching name of the controller and the Yii2 eqshen changes the reference. Try to get the slash out of the Route.
'route' => 'news/index'
or do so
[ 'news/index' => 'news/<page:\d+>', ],