An extension to maximebf's ConsoleKit
- Help - Style help output similar to symfony/console and add support for @example tag.
- Table widget - Output tabbed (help style) or framed tables.
Install the ConsoleKit extension using Composer with the following requirement:
{
"require": {
"maximebf/consolekit": "1.*",
"jasny/consolekit-extension": "1.*"
}
}
$console = new ConsoleKit\Console();
$console->addCommand('\\Jasny\\ConsoleKit\\HelpCommand', 'help', true);
Options (booleans):
headers
- First row contains header (default: false)border
- Draw a border around the table (default: true)frame
- Draw a frame between the columns of the table (default: true)skipEmpty
- Skip empty columns (default: false)
$rows = array(
array('Name', 'Occupation', 'Country'),
array('John Doe', 'Plummer', 'Netherlands'),
array('Joe Fisher', 'Cook', 'France'),
array('Jack Black', 'Actor', 'USA')
);
$table = new Jasny\ConsoleKit\Widgets\Table($textwriter, $rows, array('headers'=>true));
$table->write();