From b9b838c8c12e3fdaf312f721d87932c605f98338 Mon Sep 17 00:00:00 2001 From: Li Jianxuan Date: Tue, 18 Oct 2011 01:41:20 +0000 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E4=BA=86ajax=E5=88=86?= =?UTF-8?q?=E9=A1=B5=E7=9A=84=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../default/controllers/ReviewController.php | 19 +++++++------------ .../default/views/scripts/review/review.phtml | 17 +++-------------- 2 files changed, 10 insertions(+), 26 deletions(-) diff --git a/application/default/controllers/ReviewController.php b/application/default/controllers/ReviewController.php index 7c7df588..9c7af38a 100644 --- a/application/default/controllers/ReviewController.php +++ b/application/default/controllers/ReviewController.php @@ -452,12 +452,11 @@ class ReviewController extends Zend_Controller_Action }//reviewAction() function allreviewAction(){ + $this->_helper->layout->disableLayout(); + $this->_helper->viewRenderer->setNoRender(); - $page = $this->_getParam('page'); $uuid = $this->_request->getParam('uuid'); - $offset = 5; - $sql = "select r.uuid,r.userid,r.ts_created,u.realname,r.mdcomment,r.conclusion from mdreview r left join users u on u.id=r.userid where r.uuid='$uuid'"; @@ -467,12 +466,12 @@ class ReviewController extends Zend_Controller_Action $paginator = Zend_Paginator::factory($rows); $paginator->setCurrentPageNumber($this->_getParam('page')); - //$paginator->setItemCountPerPage(5); - //$paginator->setView($this->view); + $paginator->setItemCountPerPage(5); + $paginator->setView($this->view); Zend_View_Helper_PaginationControl::setDefaultViewPartial('review/pagination_ajax.phtml'); $list = ""; - foreach($rows as $k=>$v) + foreach($paginator as $k=>$v) { $list.='
  • @@ -485,14 +484,10 @@ class ReviewController extends Zend_Controller_Action } $stringbuffer = ""; - - - $this->_helper->layout->disableLayout(); - $this->_helper->viewRenderer->setNoRender(); - + echo $stringbuffer.'
    '.$paginator.'
    '; - } + }//allreviewAction() } diff --git a/application/default/views/scripts/review/review.phtml b/application/default/views/scripts/review/review.phtml index e253db8b..23ab8213 100755 --- a/application/default/views/scripts/review/review.phtml +++ b/application/default/views/scripts/review/review.phtml @@ -103,20 +103,9 @@