Pagination new block (Issue)

Permalink 1 user found helpful
Hi all,

I'm trying to implement pagination for a new block I built. I'm not sure if there is any way to do that automatically by concrete itself but I went for following the "search" block way.

My problem becomes when i try to print the final array result from the view. It seems like the "set" function is not setting any value. If I print THAT array (results) before setting it the values are there, after that NULL.

This is my function:

<?php
function do_pagination($qsID){      
   $db = Loader::db();   
   $pagination = Loader::helper('pagination');      
   //get conference list   
   $conferenceRS = $db->query('SELECT * FROM btConferenceItem WHERE qsID='.intval($qsID).' ORDER BY position DESC');   
   //create result array
   $p=0;
   while($conferenceRow = $conferenceRS->fetchRow()){                     
      $resultsArray[$p] = $conferenceRow;
      $p++;
    }   
    //if has data         
   if (sizeof($resultsArray)>0) {         
      $results = $resultsArray;


and my view.php

<?php    
   defined('C5_EXECUTE') or die(_("Access Denied."));
   $conferences = $controller;
$conferences->do_pagination($conferences->qsID); 
   var_dump($results);   
?>



I would be eternally thankful if someone can see what is wrong here.

Thanks!

teknotica