Download the PHP package scrnr/pagination without Composer

On this page you can find all versions of the php package scrnr/pagination. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package pagination

PHP Pagination Library

Packagist PHP Version Packagist Version Packagist License

Table Of Contents

Description :top:

This is a simple and flexible PHP library for creating pagination in your web applications. It allows you to easily paginate large sets of data and display them in smaller, more manageable chunks.

Installation :top:

You can install the library using Composer. Simply add the following lines to your composer.json file and run composer install:

Or you can use this command:

Usage :top:

To use the pagination library in your application, you need to include the Composer autoload file and create a new instance. After creating an instance, you can call the getPagination() method, passing an optional array of options as a parameter. This method to generate a string representation of the pagination links.

Here is an example of usage

Output

In this example, we first include the namespace for the Pagination class. We then require the Composer autoload file, which loads the necessary classes and files for our project. Finally, we create a new instance of the Pagination class and use it to generate pagination.

Customization Pagination Settings :top:

You can customize the pagination settings by passing an array of options to the getPagination() method. The following options are available:

Option Name Type Default Description
url string '' Represents URL of the page being paginated. This setting is required to ensure that the correct page is displayed.
uri string '/' Represents URI of the page being paginated. This setting is required to ensure that the correct page is displayed.
showArrowLinks* boolean true Determines whether arrows are displayed at the edges of the pagination. These arrows can be used to navigate to the first or last page.
showDummyLinks* boolean (showArrowLinks === true) ? true : false Determines whether dummy links are displayed. When there are many pagination pages and the showArrowLinks option is set to true, the dummy links will be displayed before the arrows links.
isGetPagination boolean false Determines whether pagination information is included in the URL as GET parameters. When this setting is enabled, the pagination information is included in the URL as query parameters (e.g., ?page=2 or ?p=2). When this setting is disabled, pagination information will be included in the URL as friendly URLs* (e.g., /page/2 or /p/2).
currentPage integer 1 Represents the current page number. This setting is required to ensure that the correct page is highlighted.
limitItems integer 15 Represents the number of items displayed on each page. This setting is required to ensure that the correct number of items are displayed.
limitPages integer 7 Represents the maximum number of pagination links to display. If there are more pages than this setting, the library will automatically limit the number of links displayed.
totalItems integer 65 Represents the total number of items being paginated. This setting is required to calculate the total number of pages.
id string 'pagination' The ID of the pagination element.
navClass string 'pagination' Represents the CSS class for the <nav> tag within tha pagination.
ulClass string 'pagination__ul' Represents the CSS class for the <ul> tag within the pagination.
liClass string 'pagination__item' Represents the CSS class for each <li> tag within the pagination.
linkClass string 'pagination__link' Represents the CSS class for each <a> tag within the pagination.
activeClass string 'pagination__link active' Represents the CSS class for the active page link
nextClass string 'pagination__link next' Represents the CSS class for the next page link.
prevClass string 'pagination__link previous' Represents the CSS class for the previous page link.
arrowLinkClass string 'pagination__link arrow' Represents the CSS class for the arrow elements within the pagination.
dummyLinkClass string 'pagination__link dummy' Represents the CSS class for the dummy link elements within the pagination.

NOTES

Option Name NOTE
showArrowLinks To display the first and last arrows, the value of the limitPages option must be greater than or equal to 4.
showDummyLinks To display dummy links, the value of the limitPages option must be greater than or equal to 6 and showArrowLinks must be true.

Conclusion :top:

The Pagination library is a simple and flexible solution for paginating large datasets. It is easy to use, easy to customize and compatible with any PHP project.

Author :top:

👤 GitHub: scrnr

License :top:

This library is released under the MIT License. Please review the LICENSE file for more information.


All versions of pagination with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package scrnr/pagination contains the following files

Loading the files please wait ....