<tfoot id='EiaCe'></tfoot>
    <legend id='EiaCe'><style id='EiaCe'><dir id='EiaCe'><q id='EiaCe'></q></dir></style></legend>
      <bdo id='EiaCe'></bdo><ul id='EiaCe'></ul>

      <i id='EiaCe'><tr id='EiaCe'><dt id='EiaCe'><q id='EiaCe'><span id='EiaCe'><b id='EiaCe'><form id='EiaCe'><ins id='EiaCe'></ins><ul id='EiaCe'></ul><sub id='EiaCe'></sub></form><legend id='EiaCe'></legend><bdo id='EiaCe'><pre id='EiaCe'><center id='EiaCe'></center></pre></bdo></b><th id='EiaCe'></th></span></q></dt></tr></i><div id='EiaCe'><tfoot id='EiaCe'></tfoot><dl id='EiaCe'><fieldset id='EiaCe'></fieldset></dl></div>

        <small id='EiaCe'></small><noframes id='EiaCe'>

        如何让 PagerDefault 查询与 Drupal 7 一起正常工作?

        How do I get PagerDefault queries to work correctly with Drupal 7?(如何让 PagerDefault 查询与 Drupal 7 一起正常工作?)
            <legend id='k3MBa'><style id='k3MBa'><dir id='k3MBa'><q id='k3MBa'></q></dir></style></legend>
              <i id='k3MBa'><tr id='k3MBa'><dt id='k3MBa'><q id='k3MBa'><span id='k3MBa'><b id='k3MBa'><form id='k3MBa'><ins id='k3MBa'></ins><ul id='k3MBa'></ul><sub id='k3MBa'></sub></form><legend id='k3MBa'></legend><bdo id='k3MBa'><pre id='k3MBa'><center id='k3MBa'></center></pre></bdo></b><th id='k3MBa'></th></span></q></dt></tr></i><div id='k3MBa'><tfoot id='k3MBa'></tfoot><dl id='k3MBa'><fieldset id='k3MBa'></fieldset></dl></div>
                <bdo id='k3MBa'></bdo><ul id='k3MBa'></ul>
                  <tbody id='k3MBa'></tbody>
              • <tfoot id='k3MBa'></tfoot>
                1. <small id='k3MBa'></small><noframes id='k3MBa'>

                  本文介绍了如何让 PagerDefault 查询与 Drupal 7 一起正常工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在运行以下代码:

                  $query = db_select('taxonomy_index', 'ti')
                    ->fields('ti', array('nid'))
                    ->condition('ti.tid', $term->tid)
                    ->condition('n.status', 1);
                  
                  $query->join('node', 'n', 'n.nid = ti.nid');
                  
                  $query->extend('PagerDefault')->limit(2);
                  
                  $nids = $query->execute()->fetchCol();
                  

                  但是寻呼机不起作用:查询中的每个项目都被返回,就好像对 PagerDefault 的调用被完全忽略了一样.我在输出中进一步输出主题('pager'),所以这不是问题.

                  but the pager does not work: every item from the query is returned, as if the call to PagerDefault is completely ignored. I am outputting theme('pager') further down in the output so that's not the problem.

                  这不是我遇到的这种失败的唯一例子,在其他几个项目中,类似的查询也每次都带回全部结果.

                  This is not the only example of this failure that I have, in several other projects similar queries also bring back the full number of results every time.

                  我已阅读所有文档,它似乎有时有效,有时无效.有人有什么想法吗?

                  I've read all the documentation, it seems to work sometimes and not other times. Anyone got any ideas?

                  干杯

                  推荐答案

                  什么时候调用 extend() 是不相关的.

                  唯一重要的是您使用了 extend() 返回的新对象.这样做的原因是 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).

                  因此,您需要使用 $query = $query->extend('PagerDefault'),就像您在回答中所做的那样(与其他调用相结合).

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

                  这篇关于如何让 PagerDefault 查询与 Drupal 7 一起正常工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                  PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)
                  • <bdo id='t7V2L'></bdo><ul id='t7V2L'></ul>
                    <i id='t7V2L'><tr id='t7V2L'><dt id='t7V2L'><q id='t7V2L'><span id='t7V2L'><b id='t7V2L'><form id='t7V2L'><ins id='t7V2L'></ins><ul id='t7V2L'></ul><sub id='t7V2L'></sub></form><legend id='t7V2L'></legend><bdo id='t7V2L'><pre id='t7V2L'><center id='t7V2L'></center></pre></bdo></b><th id='t7V2L'></th></span></q></dt></tr></i><div id='t7V2L'><tfoot id='t7V2L'></tfoot><dl id='t7V2L'><fieldset id='t7V2L'></fieldset></dl></div>

                          <small id='t7V2L'></small><noframes id='t7V2L'>

                            <tbody id='t7V2L'></tbody>
                          <legend id='t7V2L'><style id='t7V2L'><dir id='t7V2L'><q id='t7V2L'></q></dir></style></legend>
                        • <tfoot id='t7V2L'></tfoot>