2017 © Pedro Peláez
 

library telegram-bot-pagination

Telegram Bot Pagination

image

lartie/telegram-bot-pagination

Telegram Bot Pagination

  • Thursday, November 24, 2016
  • by lartie
  • Repository
  • 2 Watchers
  • 3 Stars
  • 148 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 7 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Telegram Bot Pagination

Latest Stable Version Total Downloads Latest Unstable Version License composer.lock, (*1)

Installation

Composer

composer require "lartie/telegram-bot-pagination:^1.0.0"

Usage

Test Data

$items = range(1, 100); 
$command = 'testCommand'; // optional. Default: pagination
$selectedPage = 10; // optional. Default: 1

How To Use


$cqPagination = new CallbackQueryPagination($items, $command); $cqPagination->setMaxButtons(6); $cqPagination->setWrapSelectedButton('< #VALUE# >'); $pagination = $cqPagination->pagination($selectedPage); //$cqPagination->setSelectedPage($selectedPage);

Result

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'],
            ],
        ]),
    ];
}

Code Quality

Run the PHPUnit tests with PHPUnit., (*2)

phpunit tests/

License

The MIT License (MIT). Please see License File for more information., (*3)

The Versions

24/11 2016

dev-master

9999999-dev https://github.com/lartie/telegram-bot-pagination

Telegram Bot Pagination

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

laravel pagination telegram telegram bot telegram api telegram-callback

22/11 2016

v1.0.0

1.0.0.0 https://github.com/lartie/telegram-bot-pagination

Telegram Bot Pagination

  Sources   Download

MIT

The Requires

  • php >=7.0

 

The Development Requires

laravel pagination telegram telegram bot telegram api telegram-callback