How to do drupal view execute diplay without forwarding
So I have the following code:
$name = 'somename';
$display_id = 'someid';开发者_Go百科
if ($view = views_get_view($name)) {
return $view->execute_display($display_id);
}
If I do this, Drupal would redirect to the actual view page corresponding to the display id...
Is there a way so that instead of redirecting to the actual page, Drupal would instead return the HTML generated by the $view->execute_display()
so that I can echo it rather than do a full redirection?
$output = views_embed_view($view_name, $display_id, $args);
$display_id is an optional argument. $args is an optional argument, and if used, you just pass in an array with the values in order.
精彩评论