首页 文章

仅显示condeigniter分页中的下一个和上一个链接

提问于
浏览
2

我在我的项目中使用codeigniter分页类它's works fine for me . But there is no option to tell class just show next and previous link , please see this image I want to show result paged plus I' d喜欢使用链接下一个和上一个而不是数字链接当用户点击下一个按钮我'll use Ajax to retrieve request I don't在数字链接的分页中有Ajax调用的问题但我想只是显示这个链接:)我不认为我可以解释我需要非常好,所以请看图像 . link text

这是我的视图文件:

<div style="height:200px; position:relative">
                      <div id="left_nav"></div>
                      <div id="right_nav"></div>
                          <div style="width:622px;margin:0 auto;">
                          <!-- Gallery Box1 -->
                          <?php foreach($last_profile as $l) : ?>
                          <div id="galleryBoxHolder">
                            <div id="galleryBoxContent">
                                <div id="ImageHolder">
                                    <img src="dummy_data/1.gif" />                              </div>
                                
<p><?=$l->artname?> </p>
<p style="color:#1a4688">asdasd</p> <p style="color:#1a4688 ; direction:ltr"><?=$l->length?> cm x <?=$l->width?> cm</p> </div> </div> <?php endforeach ;?> <div> <?=$links?> </div> <!-- Gallery box1 :off --> </div> </div>

请检查这个url这正是我需要的(@: Headers 购买此商品的顾客也买了)

2 回答

  • 9

    在版本2.0.3 Codeigniter中 - 要显示下一个/上一个,您可以添加以下配置设置:

    $config['display_pages'] = FALSE;
    $config['first_link'] = FALSE;
    $config['last_link'] = FALSE;
    
  • 1

    你有几个选择 . 第一个非常简单,用CSS隐藏分页模块的缩略图部分 . 第二个选项也不是太复杂:修改分页类不包括缩略图,而是将其输出限制为下一个/上一个按钮 . 这也应该是微不足道的 .

    System / Libraries / Pagination Library的第199行是处理“数字”的地方 . 这是您将删除任何附加到$ output变量的位置:

    if ($this->cur_page == $loop)
    {
      $output .= $this->cur_tag_open.$loop.$this->cur_tag_close; // Current page
    }
    else
    {
      $n = ($i == 0) ? '' : $i;
      $output .= $this->num_tag_open.'<a href="'.$this->base_url.$n.'">'.$loop.'</a>'.$this->num_tag_close;
    }
    

相关问题