Text UI
A simple and fast way to take user input and display output in text mode using PHP.
|
Public Member Functions | |
__construct (string $label, string $format) | |
setParser (?object $parser) | |
read () | |
Public Member Functions inherited from EntryInterface |
Protected Attributes | |
readonly string | $label |
readonly string | $format |
object | $parser = null |
Receives a date from the user.
Converts user input into a PHP DateTime object using date_create_from_format().
Optionally, you can process user input with a parser defined by DateTimeEntry:setParser().
Definition at line 20 of file DateEntry.php.
__construct | ( | string | $label, |
string | $format ) |
string | $label | |
string | $format | A format string accepted by date_create_from_format(). |
Definition at line 32 of file DateEntry.php.
read | ( | ) |
Implements EntryInterface.
Definition at line 54 of file DateEntry.php.
setParser | ( | ?object | $parser | ) |
A parser function that will be called by DateTimeEntry::parser($entry), where $entry is the user input.
The parser must return a string capable of being processed by date_create_from_format() according to DateTimeEntry::$format
null | object | $parser |
Definition at line 48 of file DateEntry.php.
|
protected |
Definition at line 23 of file DateEntry.php.
|
protected |
Definition at line 22 of file DateEntry.php.
|
protected |
Definition at line 24 of file DateEntry.php.