FAQ
As the title suggests, is there a simple way to do this?

Or should I create a separate model?

Here's the code:

$this->paginate = array('limit'=>30);
$this->Hashtag->Pin->bindModel(array('hasOne' => array('HashtagsPin')),
false);
$this->set('hashtag', $this->paginate('Pin', array('HashtagsPin.hashtag_id'
=> $id)));
$this->set('thought', $this->paginate('Pin', array('HashtagsPin.hashtag_id'
=> $id,'Pin.url'=>null)));

So I need to paginate 'hashtag' and 'thought' separately. I'll be attaching
infinite scroll jquery to both.

Any ideas?

Cheers

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

Search Discussions

  • JonStark at Jun 26, 2012 at 11:45 am
    I don't think it's possible with cake.

    Le mardi 26 juin 2012 05:41:16 UTC+2, 42startups a écrit :
    As the title suggests, is there a simple way to do this?

    Or should I create a separate model?

    Here's the code:

    $this->paginate = array('limit'=>30);
    $this->Hashtag->Pin->bindModel(array('hasOne' => array('HashtagsPin')),
    false);
    $this->set('hashtag', $this->paginate('Pin',
    array('HashtagsPin.hashtag_id' => $id)));
    $this->set('thought', $this->paginate('Pin',
    array('HashtagsPin.hashtag_id' => $id,'Pin.url'=>null)));

    So I need to paginate 'hashtag' and 'thought' separately. I'll be
    attaching infinite scroll jquery to both.

    Any ideas?

    Cheers
    --
    Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
    Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


    To unsubscribe from this group, send email to
    cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
  • Mark Wratten at Jun 27, 2012 at 6:01 pm
    You can only paginate one way at a time, so presumably you can set the
    associations dynamically depending on the parameters from jQuery. Though
    separate models might be cleaner as you can hard-code the associations.

    Mark
    On Monday, June 25, 2012 11:41:16 PM UTC-4, 42startups wrote:

    As the title suggests, is there a simple way to do this?

    Or should I create a separate model?

    Here's the code:

    $this->paginate = array('limit'=>30);
    $this->Hashtag->Pin->bindModel(array('hasOne' => array('HashtagsPin')),
    false);
    $this->set('hashtag', $this->paginate('Pin',
    array('HashtagsPin.hashtag_id' => $id)));
    $this->set('thought', $this->paginate('Pin',
    array('HashtagsPin.hashtag_id' => $id,'Pin.url'=>null)));

    So I need to paginate 'hashtag' and 'thought' separately. I'll be
    attaching infinite scroll jquery to both.
    --
    Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
    Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


    To unsubscribe from this group, send email to
    cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
  • 42startups at Jun 30, 2012 at 5:11 am
    Gah that'd be right. First time jumping into CakePHP, the project I'm
    working on needs pagination of HABTM model (which was difficult), and
    multiple pagination of one model on the same view (which is impossible). I
    could have sorted these problems in no time with pure PHP.

    Oh well, I ended up going with a simple iframe to have multiple pagination
    on the same page. A cheap hack, but it works.

    Cheers
    On Thursday, June 28, 2012 4:00:59 AM UTC+10, Mark Wratten wrote:

    You can only paginate one way at a time, so presumably you can set the
    associations dynamically depending on the parameters from jQuery. Though
    separate models might be cleaner as you can hard-code the associations.

    Mark
    On Monday, June 25, 2012 11:41:16 PM UTC-4, 42startups wrote:

    As the title suggests, is there a simple way to do this?

    Or should I create a separate model?

    Here's the code:

    $this->paginate = array('limit'=>30);
    $this->Hashtag->Pin->bindModel(array('hasOne' => array('HashtagsPin')),
    false);
    $this->set('hashtag', $this->paginate('Pin',
    array('HashtagsPin.hashtag_id' => $id)));
    $this->set('thought', $this->paginate('Pin',
    array('HashtagsPin.hashtag_id' => $id,'Pin.url'=>null)));

    So I need to paginate 'hashtag' and 'thought' separately. I'll be
    attaching infinite scroll jquery to both.
    --
    Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
    Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


    To unsubscribe from this group, send email to
    cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcake-php @
categoriesphp
postedJun 26, '12 at 3:41a
activeJun 30, '12 at 5:11a
posts4
users3
websitecakephp.org
irc#cakephp

People

Translate

site design / logo © 2022 Grokbase