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
+34
Original file line number
Diff line number
Diff line change
@@ -150,6 +150,40 @@ before translating contents::
150
150
However for other services the solution might be more complex. For more details,
151
151
see :doc:`/cookbook/service_container/scopes`.
152
152
153
+
Invoking Other Commands
154
+
-----------------------
155
+
156
+
If you need to implement a command that runs other dependent commands, you can fetch
157
+
these commands using the :class:`Symfony\\Component\\Console\\Application <Symfony\\Component\\Console\\Application>`'s ``find`` method.
158
+
159
+
Also note that you'll have to pass :class:`Symfony\\Component\\Console\\Input\\InputInterface` and :class:`Symfony\\Component\\Console\\Output\\OutputInterface`
160
+
as arguments to the command's ``execute`` method. This can be easily implemented
161
+
with :class:`Symfony\\Component\\Console\\Input\\ArrayInput`::
162
+
163
+
protected function execute(InputInterface $input, OutputInterface $output)
0 commit comments