Yii Framework Forum: How To Create Pagination In Yii - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

How To Create Pagination In Yii Rate Topic: -----

#1 User is offline   muppu_g 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 9
  • Joined: 01-November 12

Posted 23 November 2012 - 05:58 AM

I have created pagination in my application.But i don't how to set limit using create Command :unsure:

Plz help me :(
0

#2 User is offline   redguy 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 809
  • Joined: 02-July 10
  • Location:Central Poland

Posted 23 November 2012 - 06:05 AM

just read CPagination API reference: http://www.yiiframew...1.1/CPagination

there is even example on how to apply limit on criteria object...
red
0

#3 User is offline   muppu_g 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 9
  • Joined: 01-November 12

Posted 23 November 2012 - 06:17 AM

View Postredguy, on 23 November 2012 - 06:05 AM, said:

just read CPagination API reference: http://www.yiiframew...1.1/CPagination

there is even example on how to apply limit on criteria object...



Thank you for your quick reply :) .But my problem here is i don't have model(i mean it is an dynamic model)so i'm using createCommand instead of $criteria.so how to set limit using createCommand :-[
0

#4 User is offline   redguy 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 809
  • Joined: 02-July 10
  • Location:Central Poland

Posted 23 November 2012 - 07:34 AM

you can do this manually then:
$pagination->getLimit(); 
$pagination->getOffset();

red
0

#5 User is offline   KonApaz 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 1,323
  • Joined: 21-February 11
  • Location:Greece

Posted 23 November 2012 - 07:53 AM

View Postmuppu_g, on 23 November 2012 - 06:17 AM, said:

Thank you for your quick reply :) .But my problem here is i don't have model(i mean it is an dynamic model)so i'm using createCommand instead of $criteria.so how to set limit using createCommand :-[


It is not required to use $model in CPagination.
CPagination has also getter and setter to manipulete the current Page
Yii is the best php framework in the world!
find our demo Yii extension on www.webkit.gr
Is it post useful? please v++ ;)
0

#6 User is offline   iamjuliano 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 10-April 13

Posted 13 April 2013 - 02:18 AM

iam trying to paginate datas coming from database but i get this error>>
YiiBase::include(Article.php) [<a href='yiibase.include'>yiibase.include</a>]: failed to open stream: No such file or directory <<
can anyone help?
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

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