在 Drupal 视图中显示行数
如何显示 Drupal 视图中显示的总行数以及当前显示的总行数?
print $GLOBALS['current_view']->total_rows;
不起作用
How can I display the total number of rows shown in a Drupal view as well as the number of rows out of the total currently being shown?
print $GLOBALS['current_view']->total_rows;
does not work
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这个问题可能会有帮助
$view ->total_rows 是错误的(有点),我想要“要显示的项目”
This question might be of help
$view->total_rows is wrong (sort of), I want "Items to display"
不起作用,因为它返回行数,而不是总结果数。因此,如果您有寻呼机,则此方法不起作用。您需要
另一个更好的解决方案是实现 hook_views_pre_render()
does not work, because it returns the number of rows, not the number of total results. So if you have a pager, this doesn't work. You'll need
Another, even better solution would be to implement hook_views_pre_render()