Example #1
0
 public function __construct(Sabel_View_Pager $pager, $window = null)
 {
     $this->pager = clone $pager;
     $this->current = $pager->getPageNumber();
     $this->lastPage = $pager->getTotalPageNumber();
     if (is_numeric($window)) {
         $this->window = $window;
     }
 }
Example #2
0
 public function testInitializedPagerUse()
 {
     $pager = new Sabel_View_Pager(200, 20);
     $pager->setPageNumber(4.3);
     $this->assertEquals(200, $pager->getNumberOfItem());
     $this->assertEquals(20, $pager->getLimit());
     $this->assertEquals(4, $pager->getPageNumber());
     $this->assertEquals(10, $pager->getTotalPageNumber());
     $this->assertEquals(60, $pager->getSqlOffset());
 }