class IndexController extends Zend_Controller_Acti on public function

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
class IndexController extends Zend_Controller_Action
{
public function indexAction()
{
$tableMain = new DbTable_Index();
$main = $tableMain->getIndex();
$this->view->main = $main;
}
}
---------------------------------------------
// DbTable_Index()
class DbTable_Index extends Zend_Db_Table_Abstract
{
protected $_name='articles';
public function GetIndex($num=10) {
$select=$this->getAdapter()->select()
->from($this->_name)
;
$paginator = new Zend_Paginator(new Zend_Paginator_Adapter_DbSelect($select));
$paginator->setCurrentPageNumber(1)
->setItemCountPerPage(1)
->setPageRange(20)
;
$paginator->setDefaultScrollingStyle(
'Sliding');
return $paginator;
}
}