Download the PHP package landish/pagination without Composer
On this page you can find all versions of the php package landish/pagination. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download landish/pagination
More information about landish/pagination
Files in landish/pagination
Package pagination
Short Description Laravel 5 Custom Pagination Presenter
License MIT
Informations about the package pagination
Landish/Pagination
Note: Works with only 5.0, 5.1 and 5.2 versions. 5.3 and above it does not work. PR's welcome!
Laravel 5 comes with Pagination class, which is perfectly rendered to match Bootstrap 3 styles.
This package gives you ability to change the display output of rendered pagination elements for Front-end Frameworks, such as: Semantic UI, Zurb Foundation, UIKit and Materialize.
With this package it is also very easy to create custom pagination HTML output.
Table of Contents
- Installation
- Usage
- Usage - Recommended Way
- Simple Pagination
- Additional Wrappers
- Appending To Pagination Links
- Create Custom Pagination
- License
Installation
To install landish/pagination
package, you have to run the following command in your Terminal, or Comand Promt:
Or manually add the following lines in to your composer.json
file:
and run the composer update
or composer install
command.
Usage
Add following lines of code in your *.blade.php
file, where you want to dispay the pagination.
For Semantic UI:
For Zurb Foundation:
For UIKit:
For Materialize (Contributed by @arandilopez):
Usage - Recommended Way
If you display pagination on several pages of your web application and have to write to the output code in several files, then this is, what I would recommend to do:
Just create Pagination.php
file in your /app/
directory and paste the following code:
Note: This example is suitable for you, if you haven't change the Laravel Application Namespace, otherwise just use your custom namespace instead of
App
.
In that case, you only have to add the following code in your blade template files:
And in future, if you decide to override the output of pagination elements, it will be much more easier to change in app/Pagination.php
file, rather then in several blade template files.
Simple Pagination
Laravel gives you ability to create "Simple Pagination", which will have only Previous
and Next
buttons, something like Bootstrap has.
The landish/pagination
package supports this kind of pagination for Semantic UI, Zurb Foundation and UIKit.
In order to use, first call the simplePaginate()
method on Eloquent Model.
And after that, add the \Simple
suffix in namespace, when displaying the pagination output. Something like this:
Additional Wrappers
If you need to add additional wrappers to your pagination output, which will be displayed only if items have pages, then you can do it like this:
Of course, you are free to change the .pagination-wrapper
and .pagination-wrapper-inner
CSS classes and the HTML.
Appending To Pagination Links
Appending to pagination links gives you ability to add extra query strings to your pagination links.
With this package you can do it with following lines of code:
Create Custom Pagination
Creating custom pagination or extending landish/pagination
package is very easy.
Landish\Pagination\PaginationHTML
class contains the following properties:
Simply extend the Landish\Pagination\Pagination
class in your app/Pagination.php
file, just like I recommended above and overwrite these properties:
After that, just simply place the following code in your blade template file.
License
The Landish/Pagination package is open-sourced software licensed under the MIT license