Skip to content

Instantly share code, notes, and snippets.

@asipple1
Created March 19, 2019 15:16
Show Gist options
  • Save asipple1/2a106704e5b523f51b6e192fb6433cc1 to your computer and use it in GitHub Desktop.
Save asipple1/2a106704e5b523f51b6e192fb6433cc1 to your computer and use it in GitHub Desktop.
use Drupal\views\Views;
parse_str($_SERVER['QUERY_STRING'], $url_query_array);
$results_view = Views::getView('view_display_name');
$results_view->setDisplay('view_machine_name');
$results_view->setArguments($url_query_array);
$results_view->preExecute();
$results_view->execute();
$view_results_count = $results_view->total_rows;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment