Skip to content

Commit 2efefea

Browse files
committed
Added a short section about registering commands
1 parent 60e0138 commit 2efefea

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

console.rst

+9-1
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,18 @@ method. Then you can optionally define a help message and the
6161
;
6262
}
6363

64+
Registering the Command
65+
-----------------------
66+
67+
Symfony commands must be registered as services and :doc:`tagged </service_container/tags>`
68+
with the ``console.command`` tag. If the PHP class of your command extends from
69+
:class:`Symfony\\Component\\Console\\Command\\Command`, Symfony does this for
70+
you automatically.
71+
6472
Executing the Command
6573
---------------------
6674

67-
After configuring the command, you can execute it in the terminal:
75+
After configuring and registering the command, you can execute it in the terminal:
6876

6977
.. code-block:: terminal
7078

0 commit comments

Comments
 (0)