douwan2664 2015-04-12 19:20
浏览 41
已采纳

Laravel 5 Pagination CSS Breaking

I'm using Laravel 5 and Bootstrap 3.3.4

So I have the following code in my controller:

$articles = Newsarticles::paginate(10);
return view ('news',compact('articles');

Then in my view I have:

@foreach($articles as $article)

<article>
    <h2>
        <a href="{!! action('DynamicPages@show', [$article->slug]) !!}">{!! $article->headline !!}</a>
    </h2>
    <div class="body">
        {!! substr($article->article,0,500) !!}
    </div>
</article>

@endforeach

{!! $articles->render() !!}

When I run this, the pagination links at the bottom of the page come out just fine and look as they should do. However, if I change the controller to :

$articles = Newsarticles::orderBy('artdate','DESC')->paginate(10);

my pagination links come out like this:

«
1
2
3
4
5
6
»

How can one small adjustment in the code break the css?

  • 写回答

4条回答 默认 最新

      报告相同问题?

      相关推荐 更多相似问题

      悬赏问题

      • ¥15 香农解码的代码问题,无法输出解码结果
      • ¥15 Python操作注册表
      • ¥45 入门级别的一段VUE前端拍照像后端发送请求的代码,帮排错
      • ¥15 anaconda打开spyder后一直闪退,不知道怎么办
      • ¥15 解决迷宫问题中无法运行的问题
      • ¥15 关于aspnetcore中使用mqttnet库的entire
      • ¥15 关于#python#的问题,请各位专家解答!
      • ¥100 关于远控软件的两个问题
      • ¥15 基于STM32的AD8232心电采集装置设计
      • ¥15 我在wordpress里安装Ultimate menber 插件之后进行测试,点击注册之后发现网页打不了