lingenghe
请问,我的分页为什么页码会是竖着的?
控制器端:(部分参考了手册里的代码)$data = UserArtical::find()->all(); $data1 = UserArtical::find(); //print_r($data); $pages = new Pagination(['totalCount' => count($data),'pageSize'=>5]); $models = $data1->offset($pages->offset) ->limit($pages->limit) ->all(); return $this->render('UserArtical',['model'=>$models,'pages'=>$pages]);
视图:循环输出部分省略
echo LinkPager::widget(['pagination'=>$pages]);
结果页码是竖着的,如何实现横着排放页码呢?@iceluo 大神能帮我看些,我的页码是竖着放
<?php foreach ($list as $item): ?> <LI> <DIV class=page-header> <?php echo $item['ulPostID']; ?> </DIV> <DIV class=content> <?php echo $item['content']; ?> </DIV> </LI>
<?php endforeach; ?>
<?php //print_r($pages);exit; $this->widget('CLinkPager', array( 'pages' => $pages, 'header' => '', //分页前显示的内容 'maxButtonCount' => 10, //显示分页数量 'htmlOptions' => array('class' => ''), 'firstPageLabel' => '首页', 'nextPageLabel' => '下一页', 'prevPageLabel' => '上一页', 'lastPageLabel' => '末页', ) ); ?>