SUBSCRIBE VIA RSS


Subscribe to our feed

Symfony Experts

Symfony Experts
If you have an urgent question for a symfony-related issue, this is the place to ask.

Topics

Stack Overflow


The old fashioned way

RECENT TUNES

May 15, 2007 – 5:54pm Extending sfPager to paginate a large array

Inspired by a snippet on the symfony site, here is a version I created that inherits from sfPager. I had a collection of objects (not propel objects) that I needed to iterate through and this did the trick. Note that this is not really optimal because the full array has to be populated during each request, whereas something like sfPropelPager is smart enough to only fetch/hydrate the objects you are going to need for that particular view. Nonetheless, this does the job pretty well.

Posted by in  Web Development   |  

One Response to Extending sfPager to paginate a large array

  1. Luis says:

    Thank you, it’s been really useful. I agree it’s not really optimal but our use case needed to pull the whole array anyway so it’s all good.