Skip to content

[Console] Call command with options without value #18403

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 15, 2023
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