Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3081634

Browse filesBrowse files
committed
[symfony#2689] Minor tweaks to new InputArgument::IS_ARRAY details
1 parent ba7fda0 commit 3081634
Copy full SHA for 3081634

File tree

Expand file treeCollapse file tree

1 file changed

+11
-5
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+11
-5
lines changed

‎components/console/introduction.rst

Copy file name to clipboardExpand all lines: components/console/introduction.rst
+11-5Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -241,21 +241,27 @@ argument list::
241241
'Who do you want to greet (separate multiple names with a space)?'
242242
);
243243

244-
You can now access the ``names`` argument as an array::
244+
To use this, just specify as many names as you want:
245+
246+
.. code-block:: bash
247+
248+
$ app/console demo:greet Fabien Ryan Bernhard
249+
250+
You can access the ``names`` argument as an array::
245251

246252
if ($names = $input->getArgument('names')) {
247253
$text .= ' '.implode(', ', $names);
248254
}
249255

250256
There are 3 argument variants you can use:
251257

252-
=========================== =================================================================================================
258+
=========================== ===============================================================================================================
253259
Option Value
254-
=========================== =================================================================================================
260+
=========================== ===============================================================================================================
255261
InputArgument::REQUIRED The argument is required
256262
InputArgument::OPTIONAL The argument is optional and therefore can be omitted
257-
InputArgument::IS_ARRAY Allows to specify an indefinite number of arguments, must be used at the end of the argument list
258-
=========================== =================================================================================================
263+
InputArgument::IS_ARRAY The argument can can contain an indefinite number of arguments and must be used at the end of the argument list
264+
=========================== ===============================================================================================================
259265

260266
You can combine ``IS_ARRAY`` with ``REQUIRED`` and ``OPTIONAL`` like this::
261267

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.