PHP code example of vaneves / console

1. Go to this page and download the library: Download vaneves/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/ */

    

vaneves / console example snippets




use Vaneves\Console\Console;

use Vaneves\Console\Console;

$console = new Console();

$console->title('A highlighted title for the section');

$console->line('A regular line.');

$console->success('Operation executed successfully!');
$console->info('This is just highlighted information.');
$console->warning('This >warningWithIcon('This ing execution!', '✖');

use Vaneves\Console\Progress;

$total = 150;

$progress = new Progress($total);
$progress->start();

for ($i = 1; $i <= $total; $i++) {
    $progress->advance();
    usleep(30000);
}
$progress->finish();

use Vaneves\Console\Table;

$data = [
    [
        'name' => 'Van Neves',
        'domain' => 'vaneves.com',
        'profession' => 'PHP Developer',
    ],
    [
        'name' => 'Luiz Carvalho',
        'domain' => 'luizcarvalho.com',
        'profession' => 'Ruby Developer',
    ],
    [
        'name' => 'Nyl Marcos',
        'domain' => '',
        'profession' => 'PHP Developer',
    ],
];

$table = new Table($data);
$table->show();

use Vaneves\Console\Padding;

$padding = new Padding(20);
$padding->line('Apples', '$0.99');
$padding->line('Bananas', '$0.39');
$padding->line('Clementines', '$3.99');
$padding->line('Lemons', '$0.69');
$padding->line('Strawberriess', '$1.99');