Package Data | |
---|---|
Maintainer Username: | lartie |
Maintainer Contact: | log.wil.log@gmail.com (Artie) |
Package Create Date: | 2016-11-22 |
Package Last Update: | 2021-04-14 |
Home Page: | |
Language: | PHP |
License: | MIT |
Last Refreshed: | 2024-11-15 15:09:24 |
Package Statistics | |
---|---|
Total Downloads: | 269 |
Monthly Downloads: | 5 |
Daily Downloads: | 0 |
Total Stars: | 11 |
Total Watchers: | 4 |
Total Forks: | 16 |
Total Open Issues: | 0 |
composer require "lartie/telegram-bot-pagination:^1.0.0"
$items = range(1, 100);
$command = 'testCommand'; // optional. Default: pagination
$selectedPage = 10; // optional. Default: 1
$cqPagination = new CallbackQueryPagination($items, $command);
$cqPagination->setMaxButtons(6);
$cqPagination->setWrapSelectedButton('< #VALUE# >');
$pagination = $cqPagination->pagination($selectedPage); //$cqPagination->setSelectedPage($selectedPage);
if (!empty($paginate['keyboard'])) {
$paginate['keyboard'][0]['callback_data']; // testCommand?currentPage10=&nextPage=1
$paginate['keyboard'][1]['callback_data']; // testCommand?currentPage10=&nextPage=9
...
$response = [
'reply_markup' => json_encode([
'inline_keyboard' => [
$paginate['keyboard'],
],
]),
];
}
Run the PHPUnit tests with PHPUnit.
phpunit tests/
The MIT License (MIT). Please see License File for more information.