Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions console/command_in_controller.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ Imagine you want to run the ``debug:twig`` from inside your controller::
'fooArgument' => 'barValue',
// (optional) pass options to the command
'--bar' => 'fooValue',
// (optional) pass options without value
'--baz' => true,
]);

// You can use NullOutput() if you don't need the output
Expand All @@ -59,9 +61,10 @@ Imagine you want to run the ``debug:twig`` from inside your controller::
Showing Colorized Command Output
--------------------------------

By telling the ``BufferedOutput`` it is decorated via the second parameter,
it will return the Ansi color-coded content. The `SensioLabs AnsiToHtml converter`_
can be used to convert this to colorful HTML.
By telling the :class:`Symfony\\Component\\Console\\Output\\BufferedOutput`
it is decorated via the second parameter, it will return the Ansi color-coded
content. The `SensioLabs AnsiToHtml converter`_ can be used to convert this to
colorful HTML.

First, require the package:

Expand Down