Interactive menu

This commit is contained in:
kplaczek
2019-02-27 21:44:55 +01:00
parent ba3f2e954a
commit 1aee7cdc02
3 changed files with 57 additions and 3 deletions

View File

@@ -0,0 +1,42 @@
<?php
namespace App\Paper;
class InteractiveMenu
{
private $apiKey;
private $paper;
private $redis;
private $structure = [
0 =>
[
'title' => 'tytuł pierwszego menu',
1 => ['name' => 'to jest podtytuł pierwszego menu', 'action' => '', 'type' => 'output'],
2 => ['name' => 'to jest podtytuł drugiego menu', 'action' => '', 'type' => 'input'],
3 => ['name' => 'to jest podtytuł trzeciego menu', 'action' => '', 'type' => 'outputandinput'],
4 => ['name' => 'to jest podtytuł czwartego menu', 'action' => '', 'type' => 'inputandoutput'],
]
];
public function __construct()
{
$this->paper = new Paper();
$this->redis = new \Redis();
$this->redis->connect('127.0.0.1', 6379);
$this->redis->setex('interactivemenu', 10, 1);
}
public function pressed($key)
{
$this->paper->sendPrint($key);
}
}