Download the PHP package s-damian/damian-pagination-php without Composer

On this page you can find all versions of the php package s-damian/damian-pagination-php. 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 damian-pagination-php

PHP Pagination Library - Open Source

Tests Static analysis Total Downloads Latest Stable Version License

Damian Pagination PHP - Open Source Pagination

Introduction - Damian Pagination PHP

Damian Pagination PHP is an open-source PHP library designed to provide simple yet comprehensive pagination functionality.

This pagination library is compatible with all PHP projects (with or without MVC frameworks) and is also compatible with Bootstrap 5 CSS.

Key Features

Paginate easily without limits 🚀

Basic Example

Author

This package is developed by Stephen Damian.

✨ If you find this package useful, please star it on the GitHub repository.

Requirements

Summary

Introduction

This Open Source pagination contains PHP files, and one CSS style sheet.

An example of a CSS style sheet is in vendor/s-damian/damian-pagination-php/src/css directory. You can edit them according to your needs.

This pagination library also allows you to generate a per page form. This will generate an HTML <form> tag with a <select> element and clickable options.

Installation

With Composer

Without Composer

If you do not use Composer, you must manually require the necessary files before using this package. Example:

Pagination Instance Methods

Return type Method Description
void __construct(array $options = []) Constructor.
void paginate(int $count) Activate the pagination.
null or int getLimit() LIMIT: Number of items to retrieve.
null or int getOffset() OFFSET: Starting point for the LIMIT.
int getCount() Determine the total number of matching items in the data store.
int getCountOnCurrentPage() Get the number of items for the current page.
int getFrom() Get the result number of the first item in the results.
int getTo() Get the result number of the last item in the results.
int getCurrentPage() Get the current page number.
int getNbPages() Get the page number of the last available page (number of pages).
int getPerPage() The number of items to be shown per page.
bool hasPages() Determine if there are enough items to split into multiple pages.
bool hasMorePages() Determine if there are more items in the data store.
bool isFirstPage() Determine if the paginator is on the first page.
bool isLastPage() Determine if the paginator is on the last page.
bool isPage(int $pageNb) Determine if the paginator is on a given page number.
null or string getPreviousPageUrl() Get the URL for the previous page.
null or string getNextPageUrl() Get the URL for the next page.
string getFirstPageUrl() Get the URL for the first page.
string getLastPageUrl() Get the URL for the last page.
string getUrl(int $pageNb) Get the URL for a given page number.
string render() Make the rendering of the pagination in HTML format.
string perPageForm(array $options = []) Make the rendering of the per page in HTML format.

Examples

Simple Example

Example rendering of pagination with Bootstrap 5:

Damian Pagination PHP Bootstrap 5 Example

Example With SQL Queries

The db() function must be defined to return a database connection instance, such as PDO.

Depending on your needs, you can also use this library with your favorite ORM.

Example With a List of Files of a Directory

Instance Options

Language Configuration

You can change the default language, which is English ('en') by default.

Supported languages: cn, de, ee, en, es, fr, it, jp, pt, ru.

Set default language:

Support

If you discover a bug or a security vulnerability, please send a message to Stephen. Thank you.

All bugs and all security vulnerabilities will be promptly addressed.

License

This project is licensed under the MIT License. See the LICENSE file for more details.


All versions of damian-pagination-php 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 s-damian/damian-pagination-php contains the following files

Loading the files please wait ....