PHP code example of afrihost / base-command-bundle

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

    

afrihost / base-command-bundle example snippets


// in AppKernel::registerBundles()
$bundles = array(
    // there should be a bunch of symfony bundles and your bundles already added here
    new Afrihost\BaseCommandBundle\AfrihostBaseCommandBundle(),
    // ...
);

class MyCoolCommand extends ContainerAwareCommand 
{
    // your stuff here
}

use Afrihost\BaseCommandBundle\Command\BaseCommand;

// ...

class MyCoolCommand extends BaseCommand
{
    // your stuff here
}
 
 $this->getLogger()->error('Hello World!')
 
 echo $this->getIcon()->tick()->white()->bgGreen()->bold()->render() . PHP_EOL;