2014-07-07 106 views
0

我的问题是:是否有可能以相反的顺序轻松地为SF2制作WhiteOctoberPagerFantaBundle?Pagerfanta逆序分页

我的意思是,当我们正常分页时:1,2,3(最新的内容在第1页) - >使:241,240,239,....(最新的内容在241)。

谢谢。

回答

0

不,这是不可能的。我只是看看PagerFanta源代码,页面位置是硬编码的。

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

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

也许用“爆”出来,并添加reverse选项,如果是真的,将会对结果的array_reverse之前编辑的代码来存储元素数组中此部分...

+0

我会检查一下,谢谢。如果成功,请给出答案。 –