tigron / skeleton-pager
Tigron Skeleton pager functionality
Installs: 16 154
Dependents: 2
Suggesters: 0
Security: 0
Stars: 0
Watchers: 7
Forks: 1
Open Issues: 1
Requires
- tigron/skeleton-core: >=4
- dev-master
- 3.x-dev
- v3.0.12
- v3.0.11
- v3.0.10
- v3.0.9
- v3.0.8
- v3.0.7
- v3.0.6
- v3.0.5
- v3.0.4
- v3.0.3
- v3.0.2
- v3.0.1
- v3.0.0
- 2.x-dev
- v2.0.13
- v2.0.12
- v2.0.11
- v2.0.10
- v2.0.9
- v2.0.8
- v2.0.7
- v2.0.6
- v2.0.5
- v2.0.4
- v2.0.3
- v0.2.2
- v0.2.1
- v0.2.0
- v0.1.24
- v0.1.23
- 0.1.22
- 0.1.21
- 0.1.20
- v0.1.19
- v0.1.18
- v0.1.17
- v0.1.16
- v0.1.15
- v0.1.14
- v0.1.13
- v0.1.12
- v0.1.11
- v0.1.10
- v0.1.9
- v0.1.8
- v0.1.7
- v0.1.6
- v0.1.5
- v0.1.4
- v0.1.3
- v0.1.2
- v0.1.1
- v0.1.0
- v0.0.5
- v0.0.4
- v0.0.3
- v0.0.2
- v0.0.1
This package is auto-updated.
Last update: 2024-12-16 13:59:17 UTC
README
Description
This library enables paging functionality for objects created with traits in skeleton-object.
Installation
Installation via composer:
composer require tigron/skeleton-pager
Howto
$pager = new Pager('my_object');
$pager->add_sort_permission('field1');
$pager->add_sort_permission('field2');
$pager->add_sort_permission('field3');
$pager->add_sort_permission('remote_table.field4');
$pager->set_sort('field3');
$pager->set_direction('desc');
if (isset($_POST['search'])) {
$pager->set_search($_POST['search'], [ 'field2', 'remote_table.field4');
}
$pager->add_condition('field1', '=', 1);
$pager->add_condition('field2', 'IN', [ 1, 2, 3, null]);
$condition = new \Skeleton\Pager\Sql\Condition('my_other_field', '>', '0);
$pager->add_join('remote_table', remote_id', 'local_field', $condition);
$pager->page();
Configuration
/**
* Items per page
*/
\Skeleton\Pager\Config::$items_per_page = 20;
/**
* Per page list
*/
\Skeleton\Pager\Config::$per_page_list = [20, 50, 100];
/**
* Sticky pager
*
* Remember pager when navigating away and back to the module
*/
\Skeleton\Pager\Config::$sticky_pager = false;
/**
* Links template
*
* Set the template to render the page links
*/
\Skeleton\Pager\Config::$links_template = '@skeleton-pager\links.twig';