7

When using Laravel Pagination, I believe that the css classes generated are relevant to bootstrap 2 and not bootstrap 3.

{{ $products->links() }} generates

<div class="pagination">
    <ul>
        <?php echo $presenter->render(); ?>
    </ul>
</div>

However I would like it to generate:

    <ul class="pagination">
        <?php echo $presenter->render(); ?>
    </ul>

Without changing the framework code laravel/framework/src/illuminate/pagination/views/slider.php, is there a better / proper way of overriding the CSS / code generated by {{ $products->links() }}?

1
  • The correct answer which you have marked is actually correct but the second solution is more accurate. Can you change that? Commented Dec 5, 2013 at 12:04

3 Answers 3

11

I saw something in one of the latest update, I haven't tried but it looks like all you have do do is change:

'pagination' => 'pagination::slider',

In the view config to:

'pagination' => 'pagination::slider-3',

This then uses:

https://github.com/laravel/framework/blob/master/src/Illuminate/Pagination/views/slider-3.php

Sign up to request clarification or add additional context in comments.

Comments

6

Yes you can :) edit /app/config/view.php to specify the pagination value:

<?php
return array(
    'paths' => array(__DIR__.'/../views'),
    'pagination' => 'elements/pagination',
);

after that, create a view/elements/pagination.php, and put + modify the content of the following file: https://github.com/laravel/framework/blob/master/src/Illuminate/Pagination/views/slider.php

1 Comment

NP. There is a pull request for this. Watch it at: github.com/laravel/docs/pull/421
0

There is an update as said by "crynobone" on laravel forum.

4.0.*@dev (to be released as 4.0.8) now include a new view for bootstrap 3. Follow this step to have it as default

http://forums.laravel.io/viewtopic.php?id=13256

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.