1- # Telegram Bot Pagination
1+ # Telegram Bot Inline Keyboard Pagination
22
3- [ ![ Latest Stable Version] ( https://poser.pugx.org/lartie/telegram-bot-pagination/v/stable )] ( https://packagist.org/packages/lartie/telegram-bot-pagination )
4- [ ![ Total Downloads] ( https://poser.pugx.org/lartie/telegram-bot-pagination/downloads )] ( https://packagist.org/packages/lartie/telegram-bot-pagination )
5- [ ![ Latest Unstable Version] ( https://poser.pugx.org/lartie/telegram-bot-pagination/v/unstable )] ( https://packagist.org/packages/lartie/telegram-bot-pagination )
6- [ ![ License] ( https://poser.pugx.org/lartie/telegram-bot-pagination/license )] ( https://packagist.org/packages/lartie/telegram-bot-pagination )
7- [ ![ composer.lock] ( https://poser.pugx.org/lartie/telegram-bot-pagination/composerlock )] ( https://packagist.org/packages/lartie/telegram-bot-pagination )
3+ [ ![ Scrutinizer Code Quality] [ code-quality-badge ]] [ code-quality ]
4+ [ ![ Codecov] [ code-coverage-badge ]] [ code-coverage ]
5+ [ ![ Build Status] [ build-status-badge ]] [ build-status ]
6+
7+ [ ![ Latest Stable Version] [ latest-version-badge ]] [ github-tgbot-ikp ]
8+ [ ![ Total Downloads] [ total-downloads-badge ]] [ packagist-tgbot-ikp ]
9+ [ ![ License] [ license-badge ]] [ license ]
810
911- [ Installation] ( #installation )
1012 - [ Composer] ( #composer )
1113- [ Usage] ( #usage )
1214 - [ Test Data] ( #test-data )
1315 - [ How To Use] ( #how-to-use )
1416 - [ Result] ( #result )
17+ - [ Code Quality] ( #code-quality )
1518- [ License] ( #license )
1619
1720## Installation
1821
1922### Composer
2023``` bash
21- composer require " lartie/ telegram-bot- pagination:^1.0.0"
24+ composer require php- telegram-bot/inline-keyboard- pagination:^1.0.0
2225```
2326
2427## Usage
2528
2629### Test Data
2730``` php
28- $items = range(1, 100);
31+ $items = range(1, 100);
2932$command = 'testCommand'; // optional. Default: pagination
30- $selectedPage = 10; // optional. Default: 1
33+ $selectedPage = 10; // optional. Default: 1
3134```
3235
3336### How To Use
3437``` php
35-
36- $cqPagination = new CallbackQueryPagination($items, $command);
37- $cqPagination->setMaxButtons(6);
38- $cqPagination->setWrapSelectedButton('< #VALUE# >');
38+ $ikp = new InlineKeyboardPagination($items, $command);
39+ $ikp->setMaxButtons(6);
40+ $ikp->setWrapSelectedButton('< #VALUE# >');
3941
40- $pagination = $cqPagination->pagination($selectedPage); //$cqPagination->setSelectedPage($selectedPage);
41-
42+ $pagination = $ikp->pagination($selectedPage); //$ikp->setSelectedPage($selectedPage);
4243```
4344
4445### Result
4546``` php
4647if (!empty($paginate['keyboard'])) {
47- $paginate['keyboard'][0]['callback_data']; // testCommand?currentPage10= &nextPage=1
48- $paginate['keyboard'][1]['callback_data']; // testCommand?currentPage10= &nextPage=9
48+ $paginate['keyboard'][0]['callback_data']; // testCommand?currentPage=10 &nextPage=1
49+ $paginate['keyboard'][1]['callback_data']; // testCommand?currentPage=10 &nextPage=9
4950 ...
50-
51+
5152 $response = [
5253 'reply_markup' => json_encode([
5354 'inline_keyboard' => [
@@ -60,11 +61,33 @@ if (!empty($paginate['keyboard'])) {
6061
6162## Code Quality
6263
63- Run the PHPUnit tests with PHPUnit.
64-
65- phpunit tests/
64+ Run the PHPUnit tests via Composer script.
6665
66+ ``` bash
67+ composer test
68+ ```
6769
6870## License
6971
70- The MIT License (MIT). Please see [ License File] ( LICENSE.md ) for more information.
72+ The MIT License (MIT). Please see [ License File] [ license ] for more information.
73+
74+ Project based on [ Telegram Bot Pagination] [ github-lartie-tbp ] by [ lartie] [ github-lartie ] .
75+
76+
77+ [ github-tgbot-ikp ] : https://github.com/php-telegram-bot/inline-keyboard-pagination " PHP Telegram Bot Inline Keyboard Pagination on GitHub "
78+ [ packagist-tgbot-ikp ] : https://packagist.org/packages/php-telegram-bot/inline-keyboard-pagination " PHP Telegram Bot Inline Keyboard Pagination on Packagist "
79+ [ license ] : https://github.com/php-telegram-bot/inline-keyboard-pagination/blob/master/LICENSE " PHP Telegram Bot Inline Keyboard Pagination license "
80+
81+ [ code-quality-badge ] : https://img.shields.io/scrutinizer/g/php-telegram-bot/inline-keyboard-pagination.svg
82+ [ code-quality ] : https://scrutinizer-ci.com/g/php-telegram-bot/inline-keyboard-pagination/?branch=master " Code quality on Scrutinizer "
83+ [ code-coverage-badge ] : https://img.shields.io/codecov/c/github/php-telegram-bot/inline-keyboard-pagination.svg
84+ [ code-coverage ] : https://codecov.io/gh/php-telegram-bot/inline-keyboard-pagination " Code coverage on Codecov "
85+ [ build-status-badge ] : https://img.shields.io/travis/php-telegram-bot/inline-keyboard-pagination.svg
86+ [ build-status ] : https://travis-ci.org/php-telegram-bot/inline-keyboard-pagination " Build status on Travis-CI "
87+
88+ [ latest-version-badge ] : https://img.shields.io/packagist/v/php-telegram-bot/inline-keyboard-pagination.svg
89+ [ total-downloads-badge ] : https://img.shields.io/packagist/dt/php-telegram-bot/inline-keyboard-pagination.svg
90+ [ license-badge ] : https://img.shields.io/packagist/l/php-telegram-bot/inline-keyboard-pagination.svg
91+
92+ [ github-lartie-tbp ] : https://github.com/lartie/Telegram-Bot-Pagination " Telegram Bot Pagination by Lartie on GitHub "
93+ [ github-lartie ] : https://github.com/lartie " Lartie on GitHub "
0 commit comments