jasny / consolekit-extension
An extension to maximebf/consolekit
Installs: 2 698
Dependents: 1
Suggesters: 0
Security: 0
Stars: 1
Watchers: 0
Forks: 0
Open Issues: 0
Requires
- php: >=5.3.2
- maximebf/consolekit: ~1.0.0
This package is auto-updated.
Last update: 2020-07-11 10:28:41 UTC
README
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.
Installation
Install the ConsoleKit extension using Composer with the following requirement:
{
"require": {
"maximebf/consolekit": "1.*",
"jasny/consolekit-extension": "1.*"
}
}
Usage
Help
$console = new ConsoleKit\Console();
$console->addCommand('\\Jasny\\ConsoleKit\\HelpCommand', 'help', true);
Table widget
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();