2

I have a view with contextual filter and I render the view through program as below

$args=[$id];
$view = Views::getView('schedule');
$render_array = $view->buildRenderable('rest_export_1',$args);
$rendered = \Drupal::service('renderer')->renderRoot($render_array);

The view is paged with 5 results in each page. How do I pass the value to get results from the second page of the view?

1

I found setCurrentPage more suitable for my use case

$view = Views::getView('schedule');
$view->setCurrentPage($pageNum);
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.