I'm adding nodes to a view programmatically and i'm altering the pager 'x out of y' by setting the folowing in hook_views_pre_render:
$view->query->pager->total_items = $count;
$view->query->pager->current_page = isset($params['page']) ? $params['page'] : 0;
$view->query->pager->options['total_pages'] = ceil( $count / $lim );
$view->total_rows = (string) $count;
$view->items_per_page = (string) $view->query->pager->options['items_per_page'];
$view->current_page =isset($params['page']) ? $params['page'] : 0;
Let's say there are 10 pages but even with this code nothing seems to happen, nothing get's altered. When on the second page, it doesn't display the next button. How can this achieved with code? What object, array should i alter to have this result? Any help would be appreciated.
Thanks