How do I get PagerDefault queries to work correctly with Drupal 7?

拜拜、爱过 提交于 2019-12-03 14:13:03
Berdir

It is not relevant when you call extend().

The only thing that is important is that you use the new object returned by extend(). The reason for this is that extend() creates a new object which wrappes the current object (Decorator pattern).

So, you need to use $query = $query->extend('PagerDefault'), like you do in your answer (combined with other calls).

Christophe

It is not working because you have to do

$query = $query->extend('PagerDefault')->limit(2);
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!