分页后查看所有链接

发布于 2024-12-18 20:08:30 字数 498 浏览 1 评论 0原文

是否可以在<<之前或之前添加查看所有结果链接第一页 1 2 3 最后一页>>分页的链接?

我尝试了一些类似的东西:

// 在控制器(搜索)中:

if(uri_string()=='/search/results/all'){
            $config['per_page'] = $config['total_rows'];
        }else{
            $config['per_page'] = 10;
        }
$page['pagination'] = $this->pagination->create_links(); 

// 和在视图中:

echo $pagination 。 '。 '查看所有结果';

有人知道更好的方法吗?

is it possible to add a view All results link after or before the << First 1 2 3 Last >> links of the pagination?

I tried some thing like :

// in controller (search) :

if(uri_string()=='/search/results/all'){
            $config['per_page'] = $config['total_rows'];
        }else{
            $config['per_page'] = 10;
        }
$page['pagination'] = $this->pagination->create_links(); 

// and in the view :

echo $pagination .' '. '<a href="/search/results/all">View all results</a>';

Does anyone knows a better way?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

赢得她心 2024-12-25 20:08:30

我认为更好的方法是扩展 CI 分页类。例如:

class MY_Pagination extends CI_Pagination
{
      function create_links() {

           // modify the output here

           return $output;
      }
}

您可以在这里找到一个很好的示例: http://codeigniter.com/wiki/Digg_Style_Pagination__-_Non_evasive_aproach< /a>

I think the better way is to extend the CI pagination class. For example:

class MY_Pagination extends CI_Pagination
{
      function create_links() {

           // modify the output here

           return $output;
      }
}

You can find a good example here: http://codeigniter.com/wiki/Digg_Style_Pagination_-_Non_evasive_aproach

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文