Lo que deseo hacer es capturar los datos de una consulta y guardarlo en una variable con paginator, desde el controller,
no en la vista.
Este es mi codigo,
Código PHP:
$paginator = $this->_enfermedades->getPaginator($params);
$paginator->setItemCountPerPage(6);
$paginator->setCurrentPageNumber($page);
$this->view->paginator = $paginator;
Código PHP:
Zend_Paginator Object
(
[_cacheEnabled:protected] => 1
[_adapter:protected] => Zend_Paginator_Adapter_Array Object
(
[_array:protected] => Array
(
[0] => stdClass Object
(
[id] => 1
[nombre] => Aborto
)
[1] => stdClass Object
(
[id] => 2
[nombre] => Ácaros, Infestaciones
)
[2] => stdClass Object
(
[id] => 3
[nombre] => Acetonemia
)
[3] => stdClass Object
(
[id] => 4
[nombre] => Ácidez gástrica
)
[4] => stdClass Object
(
[id] => 5
[nombre] => Adenitis
)
)
[_count:protected] => 5
)
[_currentItemCount:protected] =>
[_currentItems:protected] =>
[_currentPageNumber:protected] => 1
[_filter:protected] =>
[_itemCountPerPage:protected] => 6
[_pageCount:protected] => 1
[_pageRange:protected] =>
[_pages:protected] =>
[_view:protected] =>
)
Código PHP:
$datos = Array
(
[0] => stdClass Object
(
[id] => 1
[nombre] => Aborto
)
[1] => stdClass Object
(
[id] => 2
[nombre] => Ácaros, Infestaciones
)
[2] => stdClass Object
(
[id] => 3
[nombre] => Acetonemia
)
[3] => stdClass Object
(
[id] => 4
[nombre] => Ácidez gástrica
)
[4] => stdClass Object
(
[id] => 5
[nombre] => Adenitis
)
que metodo debo utilizar para recuperar solo los datos,
Saludos