dqj5046 2015-07-27 16:53
浏览 20
已采纳

Laravel分页评论

I'm trying to "remove" the thread of my application when the pagination is used.

So I have a thread and the URL to that tread is http://localhost/rebelbb/Thread-test. When I want to Go to paginate so http://localhost/rebelbb/Thread-test?page=2 Then It needs to hide the thread. What I got now:

@if(Request::url() == Config::get('app.url').'/Thread-'.$threads->title)

But that doesn't work...

So anyone who has an tip?

How am I be able to hide the topic when the URL isn't http://localhost/rebelbb/Thread-test or http://localhost/rebelbb/Thread-test?page=1 ?

  • 写回答

1条回答 默认 最新

  • dsjklb0205 2015-07-27 17:03
    关注

    You can check in the view if there is page parameter set by using:

    @if(Request::has('page'))
    

    or you can check if the page is not the first one by doing:

    @if(Request::get('page', 1) != 1)
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 luckysheet
  • ¥25 关于##爬虫##的问题,如何解决?:
  • ¥15 ZABBIX6.0L连接数据库报错,如何解决?(操作系统-centos)
  • ¥15 找一位技术过硬的游戏pj程序员
  • ¥15 matlab生成电测深三层曲线模型代码
  • ¥50 随机森林与房贷信用风险模型
  • ¥50 buildozer打包kivy app失败
  • ¥30 在vs2022里运行python代码
  • ¥15 不同尺寸货物如何寻找合适的包装箱型谱
  • ¥15 求解 yolo算法问题