Skip to content

Commit efa7383

Browse files
committed
Merge branch '4.4'
* 4.4: [Console] Added SymfonyStyle::definitionList() and SymfonyStyle::horizontalTable()
2 parents 69fc0f8 + a5e1d81 commit efa7383

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

console/style.rst

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,39 @@ 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+
.. versionadded:: 4.4
156+
157+
The ``horizontalTable()`` method was introduced in Symfony 4.4.
158+
159+
:method:`Symfony\\Component\\Console\\Style\\SymfonyStyle::definitionList`
160+
It displays the given ``key => value`` pairs as a compact list of elements::
161+
162+
$io->definitionList(
163+
'This is a title',
164+
['foo1' => 'bar1'],
165+
['foo2' => 'bar2']
166+
['foo3' => 'bar3']
167+
new TableSeparator(),
168+
'This is another title',
169+
['foo4' => 'bar4']
170+
);
171+
172+
.. versionadded:: 4.4
173+
174+
The ``definitionList()`` method was introduced in Symfony 4.4.
175+
143176
:method:`Symfony\\Component\\Console\\Style\\SymfonyStyle::newLine`
144177
It displays a blank line in the command output. Although it may seem useful,
145178
most of the times you won't need it at all. The reason is that every helper

0 commit comments

Comments
 (0)