-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexamples.php
More file actions
32 lines (23 loc) · 824 Bytes
/
examples.php
File metadata and controls
32 lines (23 loc) · 824 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
require __DIR__.'/vendor/autoload.php';
use Dialog\Calendar;
use Dialog\InputBox;
use Dialog\MsgBox;
use Dialog\YesNo;
$calendar = new Calendar;
$calendar->title('My calendar')
->clearAsShell()
->text('Hello darkness, my old Calendar');
echo PHP_EOL.'Response is '.$calendar->show()->getAnswer().PHP_EOL;
$inputBox = new InputBox;
$inputBox->title('My inputbox')
->text('What is your name?');
echo PHP_EOL.'Response is '.$inputBox->show()->getAnswer().PHP_EOL;
$msgBox = new MsgBox;
$msgBox->title('My msgbox')
->text('Hello darkness, my old message box');
$yesNo = new YesNo;
$yesNo->title('My yesno box')
->text('Are you a Unix Lover?');
// unix exit code for true/success is zero so we cast:
echo PHP_EOL.'Response is '.(int)!($yesNo->show()->getExitCode()).PHP_EOL;