@@ -25,7 +25,8 @@ Symfony uses a defined style when printing to the command line.
25
25
It prints the section in color and with brackets around and the
26
26
actual message behind this section indication.
27
27
28
- To reproduce this style, you can use the `` formatSection`` method like this::
28
+ To reproduce this style, you can use the
29
+ :method: `Symfony\\ Component\\ Console\\ Helper\\ FormatterHelper::formatSection `::
29
30
30
31
$formattedLine = $formatter->formatSection('SomeCommand', 'Some output from within the SomeCommand');
31
32
$output->writeln($formattedLine);
@@ -37,13 +38,15 @@ Sometimes you want to be able to print a whole block of text with a background
37
38
color. Symfony uses this when printing error messages.
38
39
39
40
If you print your error message on more than one line manually, you will
40
- notice that the background is only as long as each individual line. You
41
- can use the `formatBlock ` method to create a real block output::
41
+ notice that the background is only as long as each individual line. Use the
42
+ :method: `Symfony\\ Component\\ Console\\ Helper\\ FormatterHelper::formatBlock `
43
+ togenerate a block output::
42
44
43
45
$errorMessages = array('Error!', 'Something went wrong');
44
46
$formattedBlock = $formatter->formatBlock($errorMessages, 'error');
45
47
46
- As you can see, passing an array of messages to the `formatBlock ` method creates
47
- the desired output. If you pass `true ` as third parameter, the block will be
48
- formatted with more padding (one blank line above and below the messages and 2
49
- spaces on the left and right).
48
+ As you can see, passing an array of messages to the
49
+ :method: `Symfony\\ Component\\ Console\\ Helper\\ FormatterHelper::formatBlock `
50
+ method creates the desired output. If you pass ``true `` as third parameter, the
51
+ block will be formatted with more padding (one blank line above and below the
52
+ messages and 2 spaces on the left and right).
0 commit comments