【问题标题】:Paging Results - Drupal Module分页结果 - Drupal 模块
【发布时间】:2010-05-12 16:11:26
【问题描述】:

我有自定义的 drupal 模块。我从需要分页的网络服务收到结果。 这就是我正在做的事情

$result = webservice_call_results(); $属性=数组( '边框' => 1, '细胞间距' => 0, 'cellpadding' => 5, '宽度' => 600, ); $rows = 数组(); foreach ($result->headers->RPMHeader as $data) { $行[] = 数组( l(t($data->reg_no), 回合($data->total_payment,2), $data->prepared_by ); } $headers = array(t('注册号'), t('总付款'),t('准备人')); $output =theme('table',$headers,$rows,$attributes); $output .= theme('pager', 1); // 不工作 -- 分页 $form['manufacturer_search']['table'] = array( '#type' => '标记', '#value' => $输出);

分页不工作。任何想法为什么,请帮助

【问题讨论】:

    标签: drupal


    【解决方案1】:

    您在 theme_pager 中缺少一个参数:

    theme_pager($tags = array(), $limit = 10, $element = 0, $parameters = array(), $quantity = 9)
    

    试试:

    $output .= theme('pager', NULL, 1);
    

    【讨论】:

    • 看起来问题出在此处:drupal.org/node/330748 要使其正常工作,您需要限制主题功能接收的项目数量。这通常使用数据库中的 pager_query 完成 - 但它可能不适合您的工作流程。
    猜你喜欢
    • 1970-01-01
    • 2019-07-28
    • 1970-01-01
    • 2018-01-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多