开发者

zend paginator current, next elements

I'm working in Zend Framework with pagination (using Zend Paginator). The problem is that I wanna get the first element and unset the previous element, somthing like

$elements = Zend_Paginator::factory($items);
$elements
                ->setCurrentPageNumber($this->view->getRequest()->getParam('page', 1))
                ->set开发者_JAVA百科ItemCountPerPage(10)
                ->setPageRange(5);

using something like current($elements) or next($elements); unset(previous($elements)) but doest not work Zend Paginator Object

Any idea? Zend Paginator has a similar method?


You could write your own class method that would such as

$element->unsetElement();

or whatever, then have that handle whatever you need it to. I don't think you can use unset in the context your using it in.


Does the $items variable contains the data you're planning on using?

If so, i recommend you remove the values before passing the array into the zend_paginator factory class:

unset($array[0]);
$paginator = new Zend_Paginator(new Zend_Paginator_Adapter_Array($array));  
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜