简体   繁体   中英

Multiple views for laravel 4 pagination

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.

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM