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));
精彩评论