Change Pager Css On Listview

Hi,

I’m having a play with ListView and just wondering how to change the css for the pager. I just want to make it mini pagination (pagination pagination-sm). I’ve read the docs, but can’t seem to get it to change using the ‘pager’ part of ListView. How do you do this?

Hi Jonny

this should do it


<?php $this->widget('zii.widgets.CListView', array(

	'dataProvider'=>$dataProvider,

	'itemView'=>'_view',

	'pager'=>array(

		'cssFile'=>Yii::app()->baseUrl.'/css/pagination.css' // provide a path to your css file in my case I have my file saved under root/css

	) 

)); ?>

Thanks for that, all I want to do is alter the .class associated with the pagination though.

I tried




'pager' => ['class' => 'pagination pagination-sm']



But I think that is actually trying to find a class to use rather than a css class.

Figured it out.




'pager' => [

                      'options' =>[

                        'class' => 'pagination pagination-sm'],

                      ],



Thanks

1 Like

I believe its htmlOptions not options

it’s not. But thanks for the help earlier.