Download the PHP package yidas/pagination without Composer

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

PHP Paginator with Pager Widget (pure PHP, CI, Yii, Laravel support)

Latest Stable Version License

Features


OUTLINE


DEMONSTRATION

PDO with pure PHP

Codeiginter 3 Framework

Widget Render

$pagination is the object of yidas\data\Pagination.


REQUIREMENTS

This library requires the following:


INSTALLATION

Run Composer in your project:

composer require yidas/pagination

Then initialize it at the bootstrap of application such as config file:

Codeigniter 3

Run Composer in your Codeigniter project under the folder \application:

composer require yidas/pagination

Check Codeigniter application/config/config.php:

You could customize the vendor path into $config['composer_autoload']


CONFIGURATION

The simple config and usage could refer to Demonstration.

When you are dealing with pagination, you could new yidas\data\Pagination with configuration to get pager information for data query. For example:

For more parameters, you could refer to API Documentation.

Inheritance

You could build your application data Pagination with styles Inherited from yidas\data\Pagination. For example:


USAGE

When there are too much data to be displayed on a single page, a common strategy is to display them in multiple pages and on each page only display a small portion of the data. This strategy is known as pagination.

This library uses a yidas\data\Pagination object to represent the information about a pagination scheme. In particular,

With a fully specified yidas\data\Pagination object, you can retrieve and display data partially. For example, if you are fetching data from a database, you can specify the OFFSET and LIMIT clause of the DB query with the corresponding values provided by the pagination. Below is an example:

Widget

To facilitate building the UI element that supports pagination, This library provides the yii\widgets\Pagination widget that displays a list of page buttons upon which users can click to indicate which page of data should be displayed. The widget takes a pagination object so that it knows what is the current page and how many page buttons should be displayed. For example,

$pagination is a yidas\data\Pagination object for data provider.

Customized View

The default widget view is for Bootstrap(bootstrap), you could choose a template view for your Pagination Widget:

Template Description
bootstrap Default view, supports for Bootstrap 3 and 4
simple Simple <div> with <a> tags for pure HTML/CSS style

You can also use your customized view for Pagination widget:

Inheritance

You could build your application Pagination Widget with styles Inherited from yidas\widgets\Pagination. For example:

Build URL

If you want to build UI element manually, you may use yidas\data\Pagination::createUrl() to create URLs that would lead to different pages. The method requires a page parameter and will create a properly formatted URL containing the page parameter. For example:

The formatted URL pattern is //{current-host-uri}{parameters-with-pagination}

You could also build a per-page setting URL for changing per-page when perPageParam is set:


EXAMPLES

PDO with Pure PHP

LinkPager display:

Codeiginter 3 Framework

Codeiginter 3 Framework with yidas/codeigniter-model:

LinkPager in view:


API DOCUMENTATION

Data Pagination

Public Property Type Description
$limit integer The limit of the data
$offset integer The offset of the data
$page integer The current page number (zero-based). The default value is 1, meaning the first page.
$pageCount integer Number of pages
$pageParam string Name of the parameter storing the current page index, default value is page
$perPage integer The number of items per page, default value is 20
$perPageParam string Name of the parameter storing the page size, default value is per-page
$perPageLimit array The per page number limits. The first array element stands for the minimal page size, and the second the maximal page size, default value is [1, 50]
$params array Parameters (name => value) that should be used to obtain the current page number and to create new pagination URLs
$totalCount integer Total number of items
$validatePage boolean Whether to check if $page is within valid range

Widget Pagination

Public Property Type Description
$alignCenter boolean Set the Widget pager is center align or not, default value is true
$buttonCount integer Maximum number of page buttons that can be displayed, default value is
$pagination yidas\data\Pagination The data pagination object that this pager is associated with
$firstPageLabel string The text label for the "first" page button, default value is First
$lastPageLabel string The text label for the "last" page button, default value is Last
$nextPageLabel string The text label for the "next" page button, default value is Next
$prevPageLabel string The text label for the "previous" page button, default value is Prev
$firstPageCssClass string The CSS class for the "first" page button
$lastPageCssClass string The CSS class for the "last" page button
$nextPageCssClass string The CSS class for the "next" page button
$prevPageCssClass string The CSS class for the "previous" page button
$pageCssClass string The CSS class for the each page button, default value is page-item
$ulCssClass string The CSS class for the ul element of pagination. For example, 'pagination-sm' for Bootstrap small size.
$linkAttributes array HTML attributes for the link in a pager container tag, default value is ['class' => 'page-link']
$view string The view name or absolute file path that can be used to render view. (Template view choices)

REFERENCES

Yii 2 PHP Framework - Displaying Data: Pagination

Yii 2 PHP Framework - Class yii\data\Pagination


All versions of pagination with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.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 yidas/pagination contains the following files

Loading the files please wait ....