Posted By

karmacode on 12/10/10


Tagged

drupal views


Versions (?)

Executing a view programmatically


 / Published in: PHP
 

  1. $view = views_get_view('questions');
  2. $view->set_arguments(array('keys' => $_GET['keys']));
  3. $view->build('default');
  4. $view->execute();
  5.  
  6. /** OR **/
  7.  
  8. $my_content_view = views_get_view('manage_my_content');
  9. $my_content_view->set_arguments(array($user->uid));
  10. $my_content_view->build('page_2');
  11. $my_content_view->execute('page_2');

Report this snippet  

You need to login to post a comment.