0

My question is : is it possible to easily make WhiteOctoberPagerFantaBundle for SF2 in reverse order?

I mean, when we normally have pagination: 1, 2, 3 (newest content at the 1 page) -> to make : 241,240,239,.... ( newest content at the 241).

Thank you.

Deyvid.
  • 211
  • 4
  • 10

1 Answers1

0

No, it's not possible. I just take a look in the PagerFanta source code, and the page position is hard coded.

private function generatePages()
{
    $this->calculateStartAndEndPage();

    return $this->previous().
           $this->first().
           $this->secondIfStartIs3().
           $this->dotsIfStartIsOver3().
           $this->pages().
           $this->dotsIfEndIsUnder3ToLast().
           $this->secondToLastIfEndIs3ToLast().
           $this->last().
           $this->next();
}

Maybe by editing this portion of code to store elements as an array before "imploding" them, and add a reverse option which, if is true, will make an array_reverse on the result...

Byscripts
  • 2,578
  • 2
  • 18
  • 25