Got the paginator working, but a problem, please see this screenshot of yii2 and notice page 1
https://drive.google.com/file/d/0B1_PFw--3o74RFUzR2lnOUU2U2M/view?usp=sharing
then see this screen of laravel
https://drive.google.com/file/d/0B1_PFw--3o74SVdQX3BJZXVzbk0/view?usp=sharing
page 1 is correct. I do use custom css, but have the active class. It is
.active {
background-color: #687282;
border: 1px solid #D5D5D5;
color: #ffffff;
font-size: 12px;
font-weight: bold;
height: 25px;
padding: 8px 8px;
text-decoration: none;
margin:2px;
}
In cakephp or laravel I have no trouble with my custom css for pagination, but why isn’t yii2 displaying correct. Furthermore in yii2 it is still an active link. Yet I checked the api and the “active” class is correct.
Does the yii\widgets\LinkPager do something with css that’s off the beaten path?
Laravel uses bootstrap, I believe Yii2 also, so if I can use my css in laravel then it should work in yii2, correct?
At least throw me a bone, so far I like yii2, but things like this are irritating.
Here is the method, notice I am starting with 0 as per the docs.
public function actionDlist()
{
$sch = Yii::$app->request->get('sch', 'c');
$schquy = $sch . "%";
$page = Yii::$app->request->get('page', '1');
$perpage = "5";
$offset = ($page - 1) * $perpage;
$page = $page - 1;
$count = Dog::find()->where(['like', 'dogname', $schquy, false])->count();
$pages = new Pagination(['totalCount' => $count, 'defaultPageSize' => 5, 'params' => array('sch' => $sch)]);
$pages->setPage($page);
$dogs = Dog::find()->where(['like', 'dogname', $schquy, false])
->offset($offset)
->limit($perpage)
->all();
$this->layout = 'dog/indextp';
return $this->render('dlist', [
'dogs' => $dogs,
'pages' => $pages
]);
}
It works, it paginates, but active class link is messed up.