Wednesday 13 July 2016

How to get View result programatically by passing exposed filter inputs in Drupal?

    $view = views_get_view('view_name');
    $view->exposed_input['keyword'] = $searchtext;
    $view->set_items_per_page(4);
    $view->execute();
    $view->preview();
    $results = $view->result;

No comments:

Post a Comment

Your comment is so valuable as it would help me in my growth of knowledge.