Hi everyone,
I’ve a little question for you.
I have mysite.com/cars page where I list all the cars. I’m using CListView widget in views/cars/index.php
What I would to do is change the pagination buttons, customizing rewrite rules.
Now I have on the bottom of the page mysite.com/cars?Cars_page=2, mysite.com/cars?Cars_page=3 and so on…
I would have something like mysite.com/cars/page/2 or mysite.com/cars?page=2
my rewrite rules on config are
'urlManager'=>array(
'urlFormat'=>'path',
'showScriptName'=>false,
'caseSensitive'=>false,
'rules'=>array(
'' => 'site/index',
'cars/' => 'cars/index',
'cars/<name>/<id:\d+>/' => 'cars/view',
'<controller:\w+>/<id:\d+>'=>'<controller>/view',
'<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>/<id:\d+>',
'<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
),
),
view/cars/index.php
$this->widget('zii.widgets.CListView', array(
'dataProvider'=>$dataProvider,
'itemView'=>'_view',
'ajaxUpdate'=>false,
'summaryText'=>'Results: {start}-{end} di {count}',
'pager'=> array(
'header'=>'',
'footer'=>'',
'htmlOptions' => array('class'=>'pagination pagination-lg'),
'prevPageLabel' => '<',
'nextPageLabel' => '>',
'firstPageLabel' => '«',
'lastPageLabel' => '»',
'selectedPageCssClass' => 'active',
'maxButtonCount' => 10
),
));
Anyone can help me?
Thanks