8000 [Console] Added SymfonyStyle::definitionList() and SymfonyStyle::hori… · symfony/symfony-docs@073cc9e · GitHub
[go: up one dir, main page]

Skip to content

Commit 073cc9e

Browse files
committed
[Console] Added SymfonyStyle::definitionList() and SymfonyStyle::horizontalTable()
1 parent 9b27b5f commit 073cc9e

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

console/style.rst

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,31 @@ Content Methods
140140
]
141141
);
142142

143+
:method:`Symfony\\Component\\Console\\Style\\SymfonyStyle::horizontalTable`
144+
It displays the given array of headers and rows as a compact horizontal table::
145+
146+
$io->horizontalTable(
147+
['Header 1', 'Header 2'],
148+
[
149+
['Cell 1-1', 'Cell 1-2'],
150+
['Cell 2-1', 'Cell 2-2'],
151+
['Cell 3-1', 'Cell 3-2'],
152+
]
153+
);
154+
155+
:method:`Symfony\\Component\\Console\\Style\\SymfonyStyle::definitionList`
156+
It displays the given arguments as compact table horizontally where the key::
157+
158+
$io->definitionList(
159+
'this is a title',
160+
['foo1' => 'bar1'],
161+
['foo2' => 'bar2']
162+
['foo3' => 'bar3']
163+
new TableSeparator(),
164+
'this is another title',
165+
['foo4' => 'bar4']
166+
);
167+
143168
:method:`Symfony\\Component\\Console\\Style\\SymfonyStyle::newLine`
144169
It displays a blank line in the command output. Although it may seem useful,
145170
most of the times you won't need it at all. The reason is that every helper

0 commit comments

Comments
 (0)
0