From 073cc9ebdee5d7652f285109e595527078e9194e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Pineau?= Date: Mon, 9 Sep 2019 17:20:08 +0200 Subject: [PATCH] [Console] Added SymfonyStyle::definitionList() and SymfonyStyle::horizontalTable() --- console/style.rst | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/console/style.rst b/console/style.rst index 88e605f0146..4d4cfb16f00 100644 --- a/console/style.rst +++ b/console/style.rst @@ -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:: + + $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