diff --git a/application/default/controllers/DataController.php b/application/default/controllers/DataController.php index 752f3f61..28a1d412 100755 --- a/application/default/controllers/DataController.php +++ b/application/default/controllers/DataController.php @@ -312,7 +312,14 @@ class DataController extends Zend_Controller_Action $this->view->codename=(empty($row->name_zh)?$row->name:$row->name_zh); $sql='select m.* from metadata m,category c where m.id=c.id and c.code=? order by m.title'; $state=$db->query($sql,array($code)); - $this->view->metadata = $state->fetchAll(); + $rows = $state->fetchAll(); + + $paginator = Zend_Paginator::factory($rows); + $paginator->setCurrentPageNumber($this->_getParam('page')); + $paginator->setItemCountPerPage(10); + $paginator->setView($this->view); + Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination_param.phtml'); + $this->view->paginator=$paginator; } else { //提供全部分类列表 } diff --git a/application/default/views/scripts/data/category.phtml b/application/default/views/scripts/data/category.phtml index 6fc72b63..b36f458e 100755 --- a/application/default/views/scripts/data/category.phtml +++ b/application/default/views/scripts/data/category.phtml @@ -1,39 +1,51 @@ -headTitle($this->config->title->site); - $this->headTitle($this->config->title->data); -$this->headTitle('分类浏览'); -if (!empty($this->codename)) $this->headTitle($this->codename); -$this->headTitle()->setSeparator(' - '); -$this->headLink()->appendStylesheet('/css/metadata.css'); -$this->breadcrumb('首页'); -$this->breadcrumb(''.$this->config->title->data.''); -$this->breadcrumb('分类浏览'); -if (!empty($this->codename)) $this->breadcrumb($this->codename); -$this->breadcrumb()->setSeparator(' > '); -?> -
'.$item['description'].'
+