English spoken conference
WARNING: You are browsing the documentation for Symfony 2.2 which is not maintained anymore. Consider upgrading your projects to Symfony 4.3.

Formatter Helper

Formatter Helper

The Formatter helpers provides functions to format the output with colors. You can do more advanced things with this helper than you can in Coloring the Output.

The FormatterHelper is included in the default helper set, which you can get by calling getHelperSet():

$formatter = $this->getHelperSet()->get('formatter');

The methods return a string, which you'll usually render to the console by passing it to the OutputInterface::writeln method.

This work, including the code samples, is licensed under a Creative Commons BY-SA 3.0 license.