duanbarong4617 2011-03-04 02:40
浏览 46
已采纳

Drupal中$ _REQUEST ['page']的含义是什么?

What is the meaning of $_REQUEST['page'], and this line

$total = $GLOBALS['pager_total_items'][0];

in Drupal 6?

  • 写回答

2条回答 默认 最新

  • duanbiao4025 2011-03-04 12:28
    关注

    What Phil has given is with respect to the normal php.

    In the context of Drupal however they have a different meaning.

    In Drupal if you are trying to create a listing with the pager, the $_REQUEST['page'] is set to signify that it is a pager display, and the value signifies the current page number you are viewing.

    So if you assume that there are 10 items in a every page, you can use something like

    if($_GET['page']){
        $first_in_this_page = ($_GET['page']*10)+1;
    }
    

    to get the number of the first item in the page.

    And I think $_GLOBALS['pager_total_items'][0] can be used in place of 10(that is number of items in a page) However I am not sure about $_GLOBALS['pager_total_items'][0], but I am sure about the first one.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥20 mysql架构,按照姓名分表
  • ¥15 MATLAB实现区间[a,b]上的Gauss-Legendre积分
  • ¥15 Macbookpro 连接热点正常上网,连接不了Wi-Fi。
  • ¥15 delphi webbrowser组件网页下拉菜单自动选择问题
  • ¥15 linux驱动,linux应用,多线程
  • ¥20 我要一个分身加定位两个功能的安卓app
  • ¥15 基于FOC驱动器,如何实现卡丁车下坡无阻力的遛坡的效果
  • ¥15 IAR程序莫名变量多重定义
  • ¥15 (标签-UDP|关键词-client)
  • ¥15 关于库卡officelite无法与虚拟机通讯的问题