Programatically load a view

Public

</> CopyGet raw version
php
  1. $view = views_get_view('[VIEW_NAME]');
  2. $view->set_display('[DISPLAY_ID]');
  3. $view->set_arguments(array('[ARGUMENTS]'));
  4. $view->pre_execute();
  5. $view->execute();
  6. $results = $view->result;
  7. $view->destroy();
  8.  
  9. dpm($results);