newbie360's avatar

Laravel 5 suggest the pagination don't hard coding the ul tag by default

since no logic for the ul tag

<ul class="pagination">

</ul>

i just thinking most newbies like me can easy add the open and close tag

ofc if the ul tag is not hard coding then easy change to

<ul class="pagination pull-right inline pagination-lg">

now i really don't know how to easy can do this ;(

0 likes
7 replies
clay's avatar
clay
Best Answer
Level 20

Check out the laravel docs. Is this what you mean? You can publish the views then customize however you wish.

newbie360's avatar

but if run that command and edit views/vendor/default.blade.php

it will override all ?

if i have some views

<!-- header.blade.php -->
<ul class="pagination pagination-lg">
<!-- contentA.blade.php -->
<ul class="pagination pull-right inline">
<!-- contentB.blade.php -->
<ul class="pagination pull-right pagination-lg">
<!-- footer.blade.php -->
<ul class="pagination inline pagination-lg">

it means i need create another more and more pagination view ? :( Thanks for your reply

newbie360's avatar

oops wait...

can i delete the ul open and close tag in the views/vendor/default.blade.php

so i can add the ul tag by myself in the view

newbie360's avatar

oh i deleted 4 lines in the views/vendor/default.blade.php

line 1, 2

@if ($paginator->hasPages())
    <ul class="pagination">

and last 2 lines

    </ul>
@endif

and add a new Snippet in sublime

<snippet>
    <content><![CDATA[
@if (\$${1:pagination_var}->hasPages())
    <ul class="pagination${3}">
        {{ \$${2:pagination_var}->links() }}
    </ul>
@endif
]]></content>
    <!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
    <tabTrigger>larapage</tabTrigger>
    <!-- Optional: Set a scope to limit where the snippet will trigger -->
    <!-- <scope>source.python</scope> -->
</snippet>

add the pagination just type larapage+tab

@clay thanks your tips

Snapey's avatar

the other option is put the links inside a div with a class that you can target

<div class="myPagination">{{$model->links()}}</div>

you can then target .myPagination ul {}

1 like

Please or to participate in this conversation.