You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: cookbook/console/console_command.rst
+34Lines changed: 34 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -146,6 +146,40 @@ before translating contents::
146
146
However for other services the solution might be more complex. For more details,
147
147
see :doc:`/cookbook/service_container/scopes`.
148
148
149
+
Invoking Other Commands
150
+
-----------------------
151
+
152
+
If you need to implement a command that runs other dependent commands, you can fetch
153
+
these commands using the :class:`Symfony\\Component\\Console\\Application <Symfony\\Component\\Console\\Application>`'s ``find`` method.
154
+
155
+
Also note that you'll have to pass :class:`Symfony\\Component\\Console\\Input\\InputInterface` and :class:`Symfony\\Component\\Console\\Output\\OutputInterface`
156
+
as arguments to the command's ``execute`` method. This can be easily implemented
157
+
with :class:`Symfony\\Component\\Console\\Input\\ArrayInput`::
158
+
159
+
protected function execute(InputInterface $input, OutputInterface $output)
0 commit comments