Skip to content
This repository has been archived by the owner on Mar 27, 2020. It is now read-only.

jasny/consolekit-extension

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ConsoleKit extension

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();

About

An extension to maximebf/consolekit

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages