Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel 5.0 Pagination render() method return HTML text

I have a controller which send some product to the view. In the controller I paginated the data using

...
// Controller code

Product::paginate(1) // because I only have 2 dummy data, 1 product per page
return view('product.index', compact('product'));

...

then in my product.index view I have the following code:

    <!-- Pagination link -->
    [[ $products->render() ]]
    <!-- End Paginatin link -->

The code works, but it return the HTML without being rendered by the browser as element. The resulting output is like below

<ul class="pagination"><li class="disabled"><span>«</span></li> <li class="acti![enter image description here][2]ve"><span>1</span></li><li><a href="http://localhost:3000/paketsoal/public/dashboard/my-product/?page=2">2</a></li> <li><a href="http://localhost:3000/paketsoal/public/dashboard/my-product/?page=2" rel="next">»</a></li></ul>

enter image description here

like image 425
azamuddin Avatar asked Jun 03 '26 12:06

azamuddin


1 Answers

You should use unescaped block {!! !!}:

{!! $products->render() !!}
like image 146
Limon Monte Avatar answered Jun 06 '26 03:06

Limon Monte



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!