Executing a view programmatically


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.