jasny / consolekit-extension
此包已被弃用且不再维护。未建议替代包。
maximebf/consolekit 的扩展
v1.0.2
2014-04-24 22:55 UTC
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
- 帮助 - 输出类似 symfony/console 的样式帮助,并添加对 @example 标签的支持。
- 表格小部件 - 输出分页(帮助样式)或带有边框的表格。
安装
使用以下要求通过 Composer 安装 ConsoleKit 扩展
{
"require": {
"maximebf/consolekit": "1.*",
"jasny/consolekit-extension": "1.*"
}
}
用法
帮助
$console = new ConsoleKit\Console();
$console->addCommand('\\Jasny\\ConsoleKit\\HelpCommand', 'help', true);
表格小部件
选项(布尔值)
headers
- 第一行包含标题(默认:false)border
- 在表格周围绘制边框(默认:true)frame
- 在表格列之间绘制框架(默认:true)skipEmpty
- 跳过空列(默认: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();