PHP code example of adamgaskins / gumwrapper

1. Go to this page and download the library: Download adamgaskins/gumwrapper library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

adamgaskins / gumwrapper example snippets


$gum = new Gum();
$gum->choose([ 'apple', 'banana', 'pear' ])

$result = $gum->choose([ 'apple', 'banana', 'pear', 'orange' ]);
// example: "apple"

$gum->choose(
    $options = [ 'apple', 'banana', 'pear', 'orange' ],
    $limit = 2, // enable multiselect
    $height = 10 // scroll if more than 10 items
);

$result = $gum->confirm();
// example: true

$gum->confirm(
    $prompt = 'Are you sure?',
    $affirmativeText = 'Yeah!',
    $negativeText = 'Actually, no',
    $default = false // default to "no" option
);

$result = $gum->input('What is your name?');
// example: "Adam"

$gum->input(
    $placeholder = 'Password',
    $prompt = '> ',
    $initialValue = null,
    $charLimit = 400,
    $width = 10,
    $password = true
);

$spinner = $gum->spin();
sleep(10); // do some long task
$spinner->terminate();

$gum->spin(
    $title = 'Downloading files...',
    $spinner = 'pulse'
);