Download the PHP package sjaakp/yii2-datepager without Composer

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

yii2-datepager

Paging on date values for Yii2

Latest Stable Version Total Downloads License

These classes enable database paging based on date values in the Yii 2.0 PHP Framework.

A demonstration of yii2-datepager is here.

Installation

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

"sjaakp/yii2-datepager": "*"

Or run:

composer require sjaakp/yii2-datepager "*"

You can manually install yii2-datepager by downloading the source in ZIP-format.

Using Datepager

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

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

<?= GridView::widget([
    'dataProvider' => $dataProvider,
    'columns' => [
        'date',
        'title',
        // ... more columns ...
    ],
]); ?>

Classes

ActiveDataProvider

This is an extension from its Yii-counterpart in yii\data, and can be used in the same way. It is important to set attribute $dateAttribute.

$dateAttribute

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

$interval

string Defines the interval of the pages. Must be set in a form PHP's DateInterval can understand. Default: 'P1Y' (one year).

$ascending

bool Whether the DatePager pages are rendered in ascending or descending order. Default: true (ascending).

$beginDate

string Date of the first Datepager page. If not set (default), Datepager determines this date itself. It can be set to any date within the range of the first page. Format: any PHP date format.

$endDate

string Date of the last Datepager page. If not set (default), Datepager determines this date itself. It can be set to any date within the range of the last page. Format: any PHP date format.

$dateParam

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


DatePager

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

$dataProvider

The Datepager ActiveDataProvider that this pager is associated with. Must be set.

$maxButtonCount

int The maximum number of page buttons rendered. Default: 10.

$labelFormat

null|string|callable Defines the format of the page label.

$options

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

$buttonOptions

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

$linkOptions

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

$activePageCssClass

string CSS class of the active page. Default: 'active'.

$disabledPageCssClass

string CSS class of a disabled page. Default: 'disabled'.

$prevPageLabel, $nextPageLabel

'string' Text labels for the previous and next buttons, will not be HTML encoded. If false, the button will not be rendered. Defaults: '&laquo;' and '&raquo;'.

$firstPageLabel, $lastPageLabel

'string' Text labels for the first and last buttons, will not be HTML encoded. If false (default), the button will not be rendered.

All properties, except $dataProvider and $labelFormat are direct equivalents of their counterparts in Yii's LinkPager.


All versions of yii2-datepager with dependencies

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

Loading the files please wait ....