Add parameters to CLinkPager

Hi all,

How can I add my owns parameters to the url generated by pagination buttons (CLinkPager)?

Actually  the urls are like this:

app/index.php?r=controller/action&idUser=1

IdUser is from my User model.

The idea is to use various CLinkPager in the same view. I'd like to change the page of one of them (clicking in his button) separately from others CLinkPager in the view.

Manu.

If you want to use multiple pagers on the same page, you need to differentiate them by setting 'pageVar' property of CPagination.

If you want to customize the pagination URLs, you can override CPagination::createPageUrl()

Elegant. It works perfect.

Thankyou Qiang.

Manu.

hi

I am sorry, i am abit new. do you have a sample syntax code for the change?

When you create CPagination instance in your code, you can set:

To override createPageUrl(), please read the code in CPagination and you will see it is very easy.

:-[

I got it working but when link is click it some how transform my url to the % type. need some enlightenment…

I wanted this

view this in html:index.php?r=schedule_run/admin&stat=completed&page=2

but got this when i click on the url

actual url link:index.php?r=schedule_run/admin&stat%3Dcompleted%26page=2

my code



$pages->route='schedule_run/admin';


$pages->pageVar='stat='.$_GET[stat]."&page";


I have the same problem as robrob, has anyone a solution for the problem?

Hi,

try this:

This post is missing "lines"?