PHP code example of fyre / console
1. Go to this page and download the library: Download fyre/console 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/ */
fyre / console example snippets
use Fyre\Console\Console;
$io = new Console($input, $output, $error);
$choice = $io->choice($text, $options, $default);
$io->comment($text);
$confirm = $io->confirm($text, $default);
$io->error($text, $options);
$io->info($text, $options);
$input = $io->input();
$io->progress($step, $totalSteps);
$prompt = $io->prompt($text);
$io->success($text, $options);
$io->table($data, $header);
$io->warning($text, $options);
$io->write($text, $options);
$height = Console::getHeight();
$width = Console::getWidth();
$style = Console::style($text, $options);
$wrap = Console::wrap($text, $maxWidth);
Console::BLACK; // 30
Console::RED; // 31
Console::GREEN; // 32
Console::YELLOW; // 33
Console::BLUE; // 34
Console::PURPLE; // 35
Console::CYAN; // 36
Console::WHITE; // 37
Console::GRAY; // 47
Console::DARKGRAY; // 100
Console::BOLD; // 1
Console::DIM; // 2
Console::ITALIC; // 3
Console::UNDERLINE; // 4
Console::FLASH; // 5