0

I want to pass multiple values in setArguments() and render view. I'm using below code but it's showing only 1 value instead of multiple.

 public function _ajax_generate_request_view(array $form, FormStateInterface $form_state) {
  $view = \Drupal\views\Views::getView('play_center_generate_request');
  $view->setArguments(array('23','46'));
  $view->execute();
  $render_view = $view->render();
  $ajax_response->addCommand(new HtmlCommand('#view_wrappers', $render_view));
  return $ajax_response;
}
3

Depends if you need OR or AND clause :

$view->setArguments(array('23,46'));
$view->setArguments(array('23+46'));

One string for each argument.

| improve this answer | |
  • Working....!!!! – user66981 Sep 30 '19 at 9:32

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