system
(system)
April 27, 2009, 11:56am
1
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.
qiang
(Qiang Xue)
April 27, 2009, 2:15pm
2
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()
system
(system)
April 27, 2009, 2:57pm
3
Elegant. It works perfect.
Thankyou Qiang.
Manu.
robrob
(Rob Aka Jacky)
April 30, 2009, 9:34am
4
hi
I am sorry, i am abit new. do you have a sample syntax code for the change?
qiang
(Qiang Xue)
April 30, 2009, 11:27am
5
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.
robrob
(Rob Aka Jacky)
May 6, 2009, 6:38am
6
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?
This post is missing "lines"?