I have made a very simple block that displays an array of strings as a list. I am achieving this by implementing hook_block_view() in my .module file. Right now the list displays ok, but I would like to paginate it so that only a few list items show at a time.
I am not getting the list from a database, I just have an array of strings as I mentioned before. I have been looking at theme_pager functions, but I am not sure how to use them to do what I need. Any help or examples would be greatly appreciated! Thanks!
Edit:
I have found the following code here (Adding Pagination to to custom form block results) and I am having trouble making sense of this part of it:
function latest_news() {
$query = db_select('node', 'node');
$query = $query->fields('node', array('nid'))
->condition('node.status', 1) //Published.
->condition('node.type', 'auction_news');
$query = $query->extend('PagerDefault');
$result = $query->limit(20)->orderBy('node.created','DESC')>execute()>fetchAll(PDO::FETCH_ASSOC);
$paging = theme('pager');
return theme('latest_news',array('data' => $result,'paging'=>$paging));
}
Could someone please explain how this part could be modified to use a simple list of strings instead of a database query? Thank you very much in advance!