Yii Framework Forum: Add parameters to CLinkPager - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

Add parameters to CLinkPager Rate Topic: -----

#1 User is offline   manu 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 9
  • Joined: 27-April 09

Posted 27 April 2009 - 06:56 AM

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.
0

#2 User is offline   qiang 

  • Yii Project Lead
  • Yii
  • Group: Yii Dev Team
  • Posts: 5,875
  • Joined: 04-October 08
  • Location:DC, USA

Posted 27 April 2009 - 09:15 AM

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()
0

#3 User is offline   manu 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 9
  • Joined: 27-April 09

Posted 27 April 2009 - 09:57 AM

Elegant. It works perfect.

Thankyou Qiang.

Manu.
0

#4 User is offline   robrob 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 10
  • Joined: 16-April 09

Posted 30 April 2009 - 04:34 AM

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

0

#5 User is offline   qiang 

  • Yii Project Lead
  • Yii
  • Group: Yii Dev Team
  • Posts: 5,875
  • Joined: 04-October 08
  • Location:DC, USA

Posted 30 April 2009 - 06:27 AM

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.
0

#6 User is offline   robrob 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 10
  • Joined: 16-April 09

Posted 06 May 2009 - 01:38 AM

:-[

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";


0

#7 User is offline   Lollinger.de 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 79
  • Joined: 19-May 09
  • Location:Ulm, Germany

Posted 28 May 2009 - 03:22 AM

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

#8 User is offline   qwerty 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 290
  • Joined: 20-November 08

Posted 28 May 2009 - 04:57 AM

Hi,
try this:


0

#9 User is offline   gallego123 

  • Advanced Member
  • PipPipPip
  • Yii
  • Group: Members
  • Posts: 535
  • Joined: 11-August 09
  • Location:Argentina

Posted 11 January 2010 - 10:58 AM

This post is missing "lines"?
KISS - Keep It Simple Stupid
ASAP-As Soon As Possible
http://www.yiiframew...oc/cookbook/71/
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users