2009年8月6日星期四

Re: [fw-db] Zend_Paginator_Adapter_DbSelect Warning: Division by zero

There is no page 0. Try 1 instead.

-Matt

On Thursday, August 6, 2009, whisher <whisher@mp4.it> wrote:
>
> Hi.
> May be I'm wrong but with
> this code I get Warning: Division by zero in library/Zend/Paginator.php on line 995
>
> public function indexAction()
> {
> $model = $this->_getModel();
> $adapter = new Zend_Paginator_Adapter_DbSelect($model->fetchAllToPaginator());
> $paginator = new Zend_Paginator($adapter);
> $paginator->setCurrentPageNumber('0');
> //$paginator->setItemCountPerPage('10');
> var_dump(count($paginator));
> // $paginator->setCurrentPageNumber('0');
> //$this->view->articles = $paginator;
> }
>
>
> from the reference
>
> setItemCountPerPage | Sets the maximum number of items to display on a page (default 10).
>
> so I don't see the point :(
>
> What's the trouble ?
>
> Bye
>
>
> View this message in context: Zend_Paginator_Adapter_DbSelect Warning: Division by zero
> Sent from the Zend DB mailing list archive <http://www.nabble.com/Zend-DB-f16192.html> at Nabble.com.
>

没有评论: