arrayszend-frameworkobjectzend-paginator

Convert zend paginator to array


i have used zend pagination in my controller action.it returns zend paginator object that is in my controller its like this

$this->view->paginator=$paginator;

in my view i am doing so to iterate

 foreach($this->paginator as $record){
   <?php echo $record['column_name1'];?>
   <?php echo $record['column_name2'];?>
 }

i need the first row of this paginator that is i want to convert this to simple ARRAY so that i easily get what i need ???


Solution

  • foreach($this->paginator as $key=>$record){
    if($key == 0){
     $var1 = $record['column_name1']; //save what u need
     $var2 = $record['column_name2'];
     }
     else{
         break;
         }
    }