3
votes

I have an admin and home page with different layouts(HTML and CSS). Is there a way to have two different views for the pagination? I know how to customize but not how to create two views for pagination.

The problem is that in Laravel 4 you define your pagination view on a config file located at app/config/view.php and it does not have the option to define multiple views, just one.

2
Yes, basically I want two separate views for the pagination. The pagination on the admin and home page have different html and classes. So my idea was to call the links() method with the view I want, like $result->links('admin');Diego Castro

2 Answers

1
votes

Paginator::setViewName()

The Paginator facade maps to Illuminate\Pagination\Environment. The pagination service provider uses this exact method to specify the view name in the config file, so just use it to overwrite the config default.

0
votes

If you have a home and an adming page, than those should be two separate .php files/views. Also your controller should have two separate method to create/controll these views. If you got this, than just pass two different pagination from your controllers and style them differently in your two separate view. This should be the MVC way to solve your problem and create your website.