Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 

README.markdown

CLInput

A library for more robust command-line input from CLI PHP scripts.

Installation

CLInput requires the ncurses library for PHP. It's available here http://pecl.php.net/package/ncurses or via your package manager.

Usage

Prompt for an email address:

$email = $input->email();

Prompt for a password:

$password = $input->password();

Prompt for text that matches a validation function

$tommy = $input->text('Input the word tommy', function($result) {
    return $result == 'tommy';
}, 'I told you to input tommy');

Allow the user to select an option from a list:

$option = $input->select(array(
    'the first option',
    'another option',
    'or maybe you want this one?'
));

Check out example.php for a complete example.

About

ncurses-based menu widgets for PHP CLI scripts

Resources

Releases

No releases published

Packages

No packages published

Languages

You can’t perform that action at this time.