Download the PHP package sjaakp/yii2-alphapager without Composer

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

Yii2 Alphapager

Latest Stable Version Total Downloads License

Yii2 Alphapager performs alphabetic paging with for instance GridViews or ListViews.

Just use sjaakp\alphapager\ActiveDataProvider in stead of your normal yii\dataActiveDataProvider, and put an AlphaPager widget in front of your GridView, and you're running.

Likewise with sjaakp\alphapager\ArrayDataProvider.

Alpha paging is compatible with normal pagination. You can use them together.

A demonstration of Yii2 Aphapager is here.

Important notice

Yii2 Alphapager's ActiveDataProvider is only proven to work with MySQL and MariaDB databases. It should also work with SQLite and Cubrid, but this is not tested.

In contrast to the Yii philosophy, Yii2 Alphapager is not transparent to the database, as I'm sorry to say. Presumably, ActiveDataProvider can be made to work with Oracle, Postgres, and MSSQL as well. See the comments near $regex in ActiveDataProvider.php for details. If you can provide more information on using Yii2 Alphapager with other databases, I'd be glad to hear it.

Installation

The preferred way to install Yii2 Alphapager is through Composer. Either add the following to the require section of your composer.json file:

"sjaakp/yii2-alphapager": "*"

Or run:

composer require sjaakp/yii2-alphapager "*"

You can manually install Yii2 Alphapager by downloading the source in ZIP-format.

Usage

Using Yii2 Alphapager is easy. A minimum usage scenario would look like the following. In PersonController.php we would have something like:

<?= AlphaPager::widget([
    'dataProvider' => $dataProvider
]) ?>

<?= GridView::widget([
    'dataProvider' => $dataProvider,
    'columns' => [
        'last_name',
        'first_name',
    ],
]); ?>

Classes

ActiveDataProvider and ActiveArrayProvider

These are extensions from their Yii-counterparts in yii\data, and can be used in the same way. It is important to set attribute $alphaAttribute.

$alphaAttribute

Set this to the name of the attribute which is used to define the pages. Must be set.

$alphaDigits

Setting for the way attribute values starting with a digit are handled. Can have the following values:

$alphaPages

Settings to modify alpha pagers operation. For normal use, this can remain the default value of [] (empty array). For more information, see the _AlphaTrait.php source.

$alphaDefault

Default page value; this page opens when no explicit page is given. Default value: 'A'.

$alphaParam

The alphapager HTML parameter name. Default value: 'alpha'. Might be changed if there is a conflict with other functionality.


AlphaPager

This is the widget that renders the actual alphapager. The attribute $dataProvider must be set.

$dataProvider

The Yii2 Alphapager ActiveDataProvider or ArrayDataProvider that this pager is associated with. Must be set.

$preButtons

array Page values of buttons which should appear left of the alphabetical buttons. Set this to [] if you don't want an 'all' button. Default: [ 'all' ].

$postButtons

array Page values of buttons which should appear right of the alphabetical buttons. Set this to [] if you don't want an '#' (non-alphabetic) button. Default: [ 'symbol' ].

$lowerCase

boolean Whether the alphabetic buttons are rendered in lower case. Default: false.

$options

array HTML options for the alphapager container tag. Default: [ 'class' => 'pagination' ], compatible with Bootstrap.

$buttonOptions

array HTML options for the alphapager buttons. Default: [ 'class' => 'page-item' ], compatible with Bootstrap 4.

$linkOptions

array HTML options for the alphapager links. Default: [ 'class' => 'page-link' ], compatible with Bootstrap 4.


All versions of yii2-alphapager with dependencies

PHP Build Version
Package Version
Requires yiisoft/yii2 Version *
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 sjaakp/yii2-alphapager contains the following files

Loading the files please wait ....