PHP Класс ConsoleKit\Widgets\Dialog

Наследование: extends AbstractWidget
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
ask ( string $text, string $default = '', boolean $displayDefault = true ) : string Writes $text and reads the user's input
confirm ( string $text, string $expected = 'y', array $choices = ['Y', 'n'], string $default = 'y', string $errorMessage = 'Invalid choice' ) : boolean Writes $text (followed by the list of choices) and reads the user response.

Описание методов

ask() публичный Метод

Writes $text and reads the user's input
public ask ( string $text, string $default = '', boolean $displayDefault = true ) : string
$text string
$default string
$displayDefault boolean
Результат string

confirm() публичный Метод

Returns true if it matches $expected, false otherwise if($dialog->confirm('Are you sure?')) { ... } if($dialog->confirm('Your choice?', null, array('a', 'b', 'c'))) { ... }
public confirm ( string $text, string $expected = 'y', array $choices = ['Y', 'n'], string $default = 'y', string $errorMessage = 'Invalid choice' ) : boolean
$text string
$expected string
$choices array
$default string
$errorMessage string
Результат boolean