Nothing seems to be working.
Used the code snippet but when I "print_r()" he paginator then I am not able
to see the total number of records, total pages formed etc.
Also, I m not sure whether use of fetchAll is appropriate or not. What is
the use of fetching all the records? Can't we do something like .. just
fetch the rows to be displayed and the count(*) of the query to get the
total records.
Kindly advice!
Ashish Sharma
TL R&D
411161 wrote:
>
> I have it working, but I am not sure how to create links for next, last,
> first, previous, numbers, etc.. I am also not sure how to handle links in
> my controller.
> This is what I have so far."
>
> controller:
> public function paginateAction() {
>
> $sql = 'SELECT * FROM runz_miles WHERE empl_no = 31713';
> $this->view->result = $this->db->fetchAll($sql);
> $paginator = Zend_Paginator::factory($this->view->result);
> $paginator->setCurrentPageNumber(15);
> $this->view->paginator = $paginator;
> }
>
> in my view I have:
> <table>
> <?
> foreach($this->paginator as $key => $row){
>
> echo "<tr><td>" .$row['EMPL_NO']
> . "</td>\n";
> echo "<td>" .$row['PRISM_ORG_CODE']
> . "</td></tr>\n";
> }
> ?>
> </table>
>
> How do I create the links and I how do I handle the action so that it will
> not try and call the sql again?
>
--
View this message in context:
http://www.nabble.com/Looking-for-a-complete-Complete-Zend_Paginator-example-tp19731530p20131009.html
Sent from the Zend Framework mailing list archive at Nabble.com.