1- .. include :: /Includes.rst.txt
1+ :navigation-title: Create a command
22
3- .. _console-command-tutorial :
3+ .. include :: /Includes.rst.txt
4+ .. _console-command-tutorial :
45
5- ========
6- Tutorial
7- ========
8-
9- Create a console command from scratch
10- =====================================
6+ ===============================================
7+ Tutorial: Create a console command from scratch
8+ ===============================================
119
1210A console command is always situated in an extension. If you want to create
1311one, :ref: `kickstart a custom extension <extension-kickstart >` or use your
1412sitepackage extension.
1513
16- .. _console-command-tutorial-create :
14+ .. _console-command-tutorial-create :
1715
1816Creating a basic command
1917========================
@@ -27,7 +25,7 @@ created by different means.
2725This command can be found in the
2826`Examples extension <https://github.com/TYPO3-Documentation/t3docs-examples >`__.
2927
30- .. _console-command-tutorial-registration-services :
28+ .. _console-command-tutorial-registration-services :
3129
32301. Register the command
3331-----------------------
@@ -74,8 +72,8 @@ The following attributes are available:
7472 Give a short description. It will be displayed in the list of commands and
7573 the help information of the command.
7674
77- .. _deactivating-the-command-in-scheduler :
78- .. _schedulable :
75+ .. _deactivating-the-command-in-scheduler :
76+ .. _schedulable :
7977
8078:yaml: `schedulable `
8179 By default, a command can be used in the :doc: `scheduler
@@ -116,7 +114,7 @@ The following two methods should be overridden by your class:
116114 return the constants
117115 :php: `Command::SUCCESS ` or :php: `Command::FAILURE `.
118116
119- .. seealso ::
117+ .. seealso ::
120118
121119 A detailed description and an example can be found in
122120 `the Symfony Command Documentation <https://symfony.com/doc/current/console.html >`_.
@@ -126,17 +124,17 @@ The following two methods should be overridden by your class:
126124
127125The above example can be run via command line:
128126
129- .. tabs ::
127+ .. tabs ::
130128
131- .. group-tab :: Composer-based installation
129+ .. group-tab :: Composer-based installation
132130
133- .. code-block :: bash
131+ .. code-block :: bash
134132
135133 vendor/bin/typo3 examples:dosomething
136134
137- .. group-tab :: Classic mode installation (no Composer)
135+ .. group-tab :: Classic mode installation (no Composer)
138136
139- .. code-block :: bash
137+ .. code-block :: bash
140138
141139 typo3/sysext/core/bin/typo3 examples:dosomething
142140
@@ -146,7 +144,7 @@ succeeded.
146144.. note ::
147145 If a newly created or changed command is not found, clear the cache:
148146
149- .. code-block :: bash
147+ .. code-block :: bash
150148
151149 vendor/bin/typo3 cache:flush
152150
@@ -198,17 +196,17 @@ Add an optional argument and an optional option to your command:
198196This command takes one optional argument :php: `wizardName ` and one optional option,
199197which can be passed on the command line:
200198
201- .. tabs ::
199+ .. tabs ::
202200
203- .. group-tab :: Composer-based installation
201+ .. group-tab :: Composer-based installation
204202
205- .. code-block :: bash
203+ .. code-block :: bash
206204
207205 vendor/bin/typo3 examples:createwizard [-b] [wizardName]
208206
209- .. group-tab :: Classic mode installation (No Composer)
207+ .. group-tab :: Classic mode installation (No Composer)
210208
211- .. code-block :: bash
209+ .. code-block :: bash
212210
213211 typo3/sysext/core/bin/typo3 examples:createwizard [-b] [wizardName]
214212
@@ -224,7 +222,7 @@ User interaction on the console
224222You can create a :php: `SymfonyStyle ` console user interface from the
225223:php: `$input ` and :php: `$output ` parameters to the :php: `execute() ` function:
226224
227- .. code-block :: php
225+ .. code-block :: php
228226 :caption: EXT:examples/Classes/Command/CreateWizardCommand.php
229227
230228 use Symfony\Component\Console\Style\SymfonyStyle;
0 commit comments