dzuritaa's avatar

Problem using pagination

Hello! I'm using a pagination for the first time, but I'm running to a small issue, I'm working with laravel 5 so I have the pagination in my controller like this

$news= News::where('id_tipos_noticias', '=', 1)->latest('created_at')->paginate(10);

return view('news.index', compact('news'));

And in my view I do a foreach of the news, and its working, but when I put the code for the pagination it's not working

{{$news->render()}}

It's displaying the HTML code in the page but not running this code

<ul class="pagination"><li class="disabled"><span>«</span></li> <li class="active"><span>1</span></li><li><a href="http://www.techkum.com/noticias/noticias/?page=2">2</a></li> <li><a href="http://www.techkum.com/noticias/noticias/?page=2" rel="next">»</a></li></ul> 

I have no idea what I'm missing, hope you guys can help me

Thanks

0 likes
2 replies
taijuten's avatar
Level 10

using double brackets makes any output save, so it won't parse any HTML etc.

use

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

to output html

Please or to participate in this conversation.