From bbeb39619f3d6ff3d217cccb50e051fec5c62f19 Mon Sep 17 00:00:00 2001 From: Raul Fraile Date: Tue, 13 Mar 2012 09:34:15 +0100 Subject: [PATCH] Improved coloring output section with OutputFormatterStyle and colors/options list --- components/console.rst | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/components/console.rst b/components/console.rst index 65701d8945a..a4cdaf480a1 100755 --- a/components/console.rst +++ b/components/console.rst @@ -117,6 +117,18 @@ output. For example:: // white text on a red background $output->writeln('foo'); +It is possible to define your own styles using the class +:class:`Symfony\\Component\\Console\\Formatter\\OutputFormatterStyle`: + + $style = new OutputFormatterStyle('red', 'yellow', array('bold', 'blink')); + $output->getFormatter()->setStyle('fire', $style); + $output->writeln('foo'); + +Available foreground and background colors are: ``black``, ``red``, ``green``, +``yellow``, ``blue``, ``magenta``, ``cyan`` and ``white``. + +And available options are: 'bold', 'underscore', 'blink', 'reverse' and 'conceal'. + Using Command Arguments -----------------------