【问题标题】:How to use strings in pagination instead of numbers如何在分页中使用字符串而不是数字
【发布时间】:2018-03-17 19:37:50
【问题描述】:

我有一个博客页面,每页显示一篇文章以及下一个和上一个链接。我用 codeigniter 分页类构建的。我希望我的博客单篇文章链接看起来像这样 http://example.com/blog/article/i-am-an-article-title

代替

http://example.com/blog/article/1

【问题讨论】:

    标签: codeigniter pagination


    【解决方案1】:
    $config['page_query_string']=TRUE;
    
    $config['query_string_segment'] = 'your_string';
    

    【讨论】:

    • 如果你有一个像example.com?page_per=7.applying 这样的网址,上面的设置让你能够使用自定义查询字符串更改页面。所以如果我使用 $config['page_query_string']=TRUE; $config['query_string_segment'] = 'your_string';我得到example.com?your_string=7
    猜你喜欢
    • 2011-01-08
    • 2012-09-07
    • 2013-09-19
    • 1970-01-01
    • 2011-09-17
    • 2016-06-19
    • 1970-01-01
    • 1970-01-01
    • 2017-08-01
    相关资源
    最近更新 更多