PHP 클래스 ConsoleKit\Widgets\Dialog

상속: extends AbstractWidget
파일 보기 프로젝트 열기: maximebf/consolekit 1 사용 예제들

공개 메소드들

메소드 설명
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