Skip to content

Commit e7b4e4a

Browse files
author
eldarQa
committed
Update README.md
1 parent 27cd376 commit e7b4e4a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ composer require php-telegram-bot/inline-keyboard-pagination:^1.0.0
2929
```php
3030
$items = range(1, 100); // required.
3131
$command = 'testCommand'; // optional. Default: pagination
32-
$selected_page = 10; // optional. Default: 1
32+
$selectedPage = 10; // optional. Default: 1
3333
$labels = [ // optional. Change button labels (showing defaults)
3434
'default' => '%d',
3535
'first' => '« %d',
@@ -40,7 +40,7 @@ $labels = [ // optional. Change button labels (showing defau
4040
];
4141

4242
// optional. Change the callback_data format, adding placeholders for data (showing default)
43-
$callback_data_format = 'command={COMMAND}&oldPage={OLD_PAGE}&newPage={NEW_PAGE}'
43+
$callbackDataFormat = 'command={COMMAND}&oldPage={OLD_PAGE}&newPage={NEW_PAGE}'
4444
```
4545

4646
### How To Use
@@ -49,13 +49,13 @@ $callback_data_format = 'command={COMMAND}&oldPage={OLD_PAGE}&newPage={NEW_PAGE}
4949
$ikp = new InlineKeyboardPagination($items, $command);
5050
$ikp->setMaxButtons(7, true); // Second parameter set to always show 7 buttons if possible.
5151
$ikp->setLabels($labels);
52-
$ikp->setCallbackDataFormat($callback_data_format);
52+
$ikp->setCallbackDataFormat($callbackDataFormat);
5353

5454
// Get pagination.
55-
$pagination = $ikp->getPagination($selected_page);
55+
$pagination = $ikp->getPagination($selectedPage);
5656

5757
// or, in 2 steps.
58-
$ikp->setSelectedPage($selected_page);
58+
$ikp->setSelectedPage($selectedPage);
5959
$pagination = $ikp->getPagination();
6060
```
6161

@@ -82,7 +82,7 @@ To get the callback data, you can use the provided helper method (only works whe
8282
// e.g. Callback data.
8383
$callback_data = 'command=testCommand&oldPage=10&newPage=1';
8484

85-
$params = InlineKeyboardPagination::getParametersFromCallbackData($callback_data);
85+
$params = InlineKeyboardPagination::getParametersFromCallbackData($callbackData);
8686

8787
//$params = [
8888
// 'command' => 'testCommand',
@@ -91,7 +91,7 @@ $params = InlineKeyboardPagination::getParametersFromCallbackData($callback_data
9191
//];
9292

9393
// or, just use PHP directly if you like. (literally what the helper does!)
94-
parse_str($callback_data, $params);
94+
parse_str($callbackData, $params);
9595
```
9696

9797
## Code Quality

0 commit comments

Comments
 (0)