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:
and my view.php
I would be eternally thankful if someone can see what is wrong here.
Thanks!
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;
Viewing 15 lines of 34 lines. View entire code block.
and my view.php
I would be eternally thankful if someone can see what is wrong here.
Thanks!