Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Console] Added SymfonyStyle::definitionList() and SymfonyStyle::horizontalTable() #12293

Merged
merged 1 commit into from
Sep 10, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions console/style.rst
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,31 @@ Content Methods
]
);

:method:`Symfony\\Component\\Console\\Style\\SymfonyStyle::horizontalTable`
It displays the given array of headers and rows as a compact horizontal table::

$io->horizontalTable(
['Header 1', 'Header 2'],
[
['Cell 1-1', 'Cell 1-2'],
['Cell 2-1', 'Cell 2-2'],
['Cell 3-1', 'Cell 3-2'],
]
);

:method:`Symfony\\Component\\Console\\Style\\SymfonyStyle::definitionList`
It displays the given arguments as compact table horizontally where the key::
xabbuh marked this conversation as resolved.
Show resolved Hide resolved

$io->definitionList(
'this is a title',
['foo1' => 'bar1'],
['foo2' => 'bar2']
['foo3' => 'bar3']
new TableSeparator(),
'this is another title',
['foo4' => 'bar4']
);

:method:`Symfony\\Component\\Console\\Style\\SymfonyStyle::newLine`
It displays a blank line in the command output. Although it may seem useful,
most of the times you won't need it at all. The reason is that every helper
Expand Down