PHP code example of wnowicki / cli

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

    

wnowicki / cli example snippets


$box = \WNowicki\Cli\Box::makeFromString("Lorem ipsum dolor sit amet,\nconsectetur adipiscing elit.", null, null, \WNowicki\Cli\Color::BG_RED);

$box2 = \WNowicki\Cli\Box::make(20, 7, \WNowicki\Cli\Color::COLOR_YELLOW, null, \WNowicki\Cli\Color::BG_WHITE)
    ->addBorder('*', null, \WNowicki\Cli\Color::BG_RED)
    ->addTitle('Box', \WNowicki\Cli\Color::COLOR_BLACK);

\WNowicki\Cli\Screen::make()
    ->putInCenter($box, 6)
    ->putInColumn($box2, 2, 1, 10)
    ->putInColumn($box2, 2, 2, 10)
    ->addTitle('Title', \WNowicki\Cli\Color::COLOR_GREEN, null, \WNowicki\Cli\Color::BG_BLACK)
    ->render();
bash
curl -sS https://getcomposer.org/installer | php
bash
php composer.phar 

cd demo
php snake.php