Skip to content

Commit

Permalink
Fixes yiisoft#11415: Added yii\console\widgets\Table to draw tables…
Browse files Browse the repository at this point in the history
… in console apps
  • Loading branch information
pana1990 authored and samdark committed Jun 29, 2017
1 parent e383105 commit b0ad73e
Show file tree
Hide file tree
Showing 4 changed files with 565 additions and 0 deletions.
16 changes: 16 additions & 0 deletions docs/guide/tutorial-console.md
Original file line number Diff line number Diff line change
Expand Up @@ -291,3 +291,19 @@ If you need to build string dynamically combining multiple styles it's better to
$name = $this->ansiFormat('Alex', Console::FG_YELLOW);
echo "Hello, my name is $name.";
```

### Tables

Since version 2.0.13 there is a widget that allows you to format table data in console. It could be used as the following:

```php
echo Table::widget([
'headers' => ['Project', 'Status', 'Participant'],
'rows' => [
['Yii', 'OK', '@samdark'],
['Yii', 'OK', '@cebe'],
],
]);
```

For details please refer to [[yii\console\widgets\Table|API documentation]].
1 change: 1 addition & 0 deletions framework/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Yii Framework 2 Change Log
- Enh #13586: Added `$preserveNonEmptyValues` property to the `yii\behaviors\AttributeBehavior` (Kolyunya)
- Bug #14192: Fixed wrong default null value for TIMESTAMP when using PostgreSQL (Tigrov)
- Enh #14081: Added `yii\caching\CacheInterface` to make custom cache extensions adoption easier (silverfire)
- Enh #11415: Added `yii\console\widgets\Table` to draw tables in console apps (pana1990, rob006, samdark, tonykor)
- Chg #14286: Used primary inputmask package name instead of an alias (samdark)
- Enh #14298: The default response formatter configs defined by `yii\web\Response::defaultFormatters()` now use the array syntax (brandonkelly)
- Bug #14304: Fixed `yii\validators\UniqueValidator` and `yii\validators\ExistValidator` to skip prefixes in case expressions are used (samdark)
Expand Down
Loading

0 comments on commit b0ad73e

Please sign in to comment.