File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change
1
+ .. index ::
2
+ single: Console Helpers; Formatter Helper
3
+
4
+ Formatter Helper
5
+ ================
6
+
7
+ The Formatter helpers provides functions to format the output with colors.
8
+ You can do more advanced things with this helper than the things in
9
+ :ref: `components-console-coloring `.
10
+
11
+ The FormatterHelper is included in the default helper set, which you can
12
+ get by calling
13
+ :method: `Symfony\\ Component\\ Console\\ Command\\ Command::getHelperSet `::
14
+
15
+ $formatter = $this->getHelperSet()->get('formatter');
16
+
17
+ The methods return a string with the data for the console, you should decide
18
+ what you are going to do with that data. In most cases you want to write
19
+ that data to the console with
20
+ :method: `Symfony\\ Component\\ Console\\ Output\\ Output::writeln `.
21
+
22
+ Print messages in a section
23
+ ---------------------------
24
+
25
+ Assume you want to print
Original file line number Diff line number Diff line change @@ -108,6 +108,8 @@ This prints::
108
108
109
109
HELLO FABIEN
110
110
111
+ .. _components-console-coloring :
112
+
111
113
Coloring the Output
112
114
~~~~~~~~~~~~~~~~~~~
113
115
You can’t perform that action at this time.
0 commit comments