开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜