Skip to content

Commit bf94952

Browse files
committed
[WIP] FormatterHelper docs
1 parent d162a5c commit bf94952

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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

components/console/introduction.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ This prints::
108108

109109
HELLO FABIEN
110110

111+
.. _components-console-coloring:
112+
111113
Coloring the Output
112114
~~~~~~~~~~~~~~~~~~~
113115

0 commit comments

Comments
 (0)