title: how to create a simple pagination in zend framework?
body: <p>I have a project on which i need to implement pagination. I tried searching various time but couldn't find any satisfactory result. That's why I'm posting my question here -- </p>
  
  <p>This is Controller file IndexController.php</p>
  
  <p>This is my indexAction, in which I'm trying to implement pagination -</p>
  
  <pre><code>public function indexAction() {
  
       $this-&gt;_helper-&gt;layout-&gt;setLayout('layout');
  
       //pagination
       $page = $this-&gt;_request-&gt;getParam('page');
       if (empty($page)) { 
          $page = 1; 
       }
       $paginator = $this-&gt;_objCoupon-&gt;getOnePageOfOrderEntries($page);
       $this-&gt;view-&gt;paginator = $paginator;
       //pagination ends
  
  
       $coupons = $this-&gt;_objCoupon-&gt;getAllcoupon();
       $storage  = new Zend_Auth_Storage_Session();
  
       $dataUser = $storage-&gt;read();
       $id       = $dataUser-&gt;id;
       //$id       = $storage-&gt;id;
       $arrCoupon = array();
  
       if(count($coupons) &gt; 0) {
  
          $i= 0;
          foreach($coupons as $couponArray) {
  
              $arrCoupon[$i]["pid"]   = $couponArray['id'];
              $arrCoupon[$i]["title"] = $couponArray['partner_name'];
              $arrCoupon[$i]["img"]   = $couponArray['companylogo'];
              $arrCoupon[$i]["value"] = $couponArray['coupon_value'];
  
              $i++;
          }
      }
      $this-&gt;view-&gt;arrCoupon = $arrCoupon;
      $this-&gt;view-&gt;selectedcheckbox = $this-&gt;selectCheckboxes;
      $this-&gt;view-&gt;id = $id;
      $this-&gt;view-&gt;asd = 'all';
  }
  </code></pre>
  
  <p>This is model file CouponModel.php</p>
  
  <p>And this is my model function </p>
  
  <pre><code>public function getOnePageOfOrderEntries($page=1) {
  
      //$paginator = $this-&gt;_coupon-&gt;getAllcoupon();
  
  
      $query = "SELECT * FROM rechargecoupon WHERE online_offer = 'N' ORDER BY id ASC";
      $paginator = new Zend_Paginator(
              new Zend_Paginator_Adapter_DbTableSelect($query)
      );
      $paginator-&gt;setItemCountPerPage(20);
      $paginator-&gt;setCurrentPageNumber($page);
      return $paginator;
  }
  </code></pre>
  
  <p>And in view I'm just trying to print paginator variable value for now. </p>
  
  <p>This is View file index.phtml</p>
  
  <pre><code>&lt;?php if (count($this-&gt;paginator)): ?&gt;
  &lt;?php print_r($this-&gt;paginator); die; ?&gt;
  </code></pre>
  
  <p>When I'm executing this file, I'm getting "Class Zend_Paginator_Adapter_DbTableSelect not found error".</p>