From 87d56ce713fc65b3b28fe389f0138cf6ca625bf5 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 7 Mar 2018 15:45:48 +0100 Subject: [PATCH 1/2] Added a short section about registering commands --- console.rst | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/console.rst b/console.rst index c0969ddc3a3..a776b9dc7d2 100644 --- a/console.rst +++ b/console.rst @@ -61,10 +61,18 @@ method. Then you can optionally define a help message and the ; } +Registering the Command +----------------------- + +Symfony commands must be registered as services and :ref:`tagged ` +with the ``console.command`` tag. If the PHP class of your command extends from +:class:`Symfony\\Component\\Console\\Command\\Command`, Symfony does this for +you automatically. + Executing the Command --------------------- -After configuring the command, you can execute it in the terminal: +After configuring and registering the command, you can execute it in the terminal: .. code-block:: terminal From 4e7fe3ec52142934b18db3a0a2988478b29e4b44 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 7 Mar 2018 16:42:20 +0100 Subject: [PATCH 2/2] Fixed a reference --- console.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/console.rst b/console.rst index a776b9dc7d2..ee8c4a78be2 100644 --- a/console.rst +++ b/console.rst @@ -64,7 +64,7 @@ method. Then you can optionally define a help message and the Registering the Command ----------------------- -Symfony commands must be registered as services and :ref:`tagged ` +Symfony commands must be registered as services and :doc:`tagged ` with the ``console.command`` tag. If the PHP class of your command extends from :class:`Symfony\\Component\\Console\\Command\\Command`, Symfony does this for you automatically.