ajax - 在 codeigniter 分页中仅显示下一个和上一个链接

标签 ajax codeigniter pagination

我在我的项目中使用 codeigniter 分页类,它对我来说效果很好。但是没有选项可以告诉类(class)只显示下一个和上一个链接, 请看这张图片我想显示结果分页加上我想用链接来链接下一个和上一个而不是数字链接当用户点击下一个按钮我将使用 Ajax 来检索请求我没有问题在数字链接中使用 Ajax 调用分页,但我只想将其显示为链接 :) 我认为我无法很好地解释我需要什么,所以请看图片。 link text

这是我的 View 文件:

<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>
                                <br />
                                <p><?=$l->artname?> </p>
                                <br />
                              <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这正是我需要的(@:title 购买此商品的顾客也购买了)

最佳答案

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

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

关于ajax - 在 codeigniter 分页中仅显示下一个和上一个链接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1347702/

相关文章:

php - 使用ajax和php传递数组

php - 根据另一个字段的输入使用 mysql 字段填充数据列表,而无需重新加载页面

php - 同时更新数据库和页面内容

php - 如何将值传递给模态?

php - anchor() 中的 Javascript 函数在 Codeigniter 中无法正常工作

html - 无法将 bootstrap3 分页居中

ruby-on-rails - will_paginate 列表中每个项目的正确编号?

php - Codeigniter更新SQL问题

php - 如何调试PHP?

php postgres SQL分页