Zend Framework  3.0
Public Member Functions | Protected Attributes | List of all members
Char Class Reference

Public Member Functions

 __construct ($promptText= 'Please hit a key', $allowedChars= '0123456789abcdefghijklmnopqrstuvwxyz', $ignoreCase=true, $allowEmpty=false, $echo=true)
 Ask the user for a single key stroke.
 
 show ()
 Show the prompt to user and return a single char.
 
 setAllowEmpty ($allowEmpty)
 
 getAllowEmpty ()
 
 setPromptText ($promptText)
 
 getPromptText ()
 
 setAllowedChars ($allowedChars)
 
 getAllowedChars ()
 
 setIgnoreCase ($ignoreCase)
 
 getIgnoreCase ()
 
 setEcho ($echo)
 
 getEcho ()
 
- Public Member Functions inherited from AbstractPrompt
 getLastResponse ()
 Return last answer to this prompt.
 
 getConsole ()
 Return console adapter to use when showing prompt.
 
 setConsole (ConsoleAdapter $adapter)
 Set console adapter to use when showing prompt.
 

Protected Attributes

 $promptText
 
 $allowEmpty
 
 $allowedChars
 
 $ignoreCase
 
 $echo
 
- Protected Attributes inherited from AbstractPrompt
 $console
 
 $lastResponse
 

Additional Inherited Members

- Static Public Member Functions inherited from AbstractPrompt
static prompt ()
 Create an instance of this prompt, show it and return response.
 

Constructor & Destructor Documentation

__construct (   $promptText = 'Please hit a key',
  $allowedChars = '0123456789abcdefghijklmnopqrstuvwxyz',
  $ignoreCase = true,
  $allowEmpty = false,
  $echo = true 
)

Ask the user for a single key stroke.

Parameters
string$promptTextThe prompt text to display in console
string$allowedCharsA list of allowed chars (i.e. "abc12345")
bool$ignoreCaseIf true, case will be ignored and prompt will always return lower-cased response
bool$allowEmptyIs empty response allowed?
bool$echoDisplay the selection after user presses key

Member Function Documentation

getAllowedChars ( )
Returns
string
getAllowEmpty ( )
Returns
bool
getEcho ( )
Returns
bool
getIgnoreCase ( )
Returns
bool
getPromptText ( )
Returns
string
setAllowedChars (   $allowedChars)
Parameters
string$allowedChars
setAllowEmpty (   $allowEmpty)
Parameters
bool$allowEmpty
setEcho (   $echo)
Parameters
bool$echo
setIgnoreCase (   $ignoreCase)
Parameters
bool$ignoreCase
setPromptText (   $promptText)
Parameters
string$promptText
show ( )

Show the prompt to user and return a single char.

Returns
string

Implements PromptInterface.

Member Data Documentation

$allowedChars
protected
$allowEmpty
protected
$echo
protected
$ignoreCase
protected
$promptText
protected