Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commit3081634

Browse files
committed
[#2689] Minor tweaks to new InputArgument::IS_ARRAY details
1 parentba7fda0 commit3081634

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

‎components/console/introduction.rst

Lines 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_ARRAYAllows to specifyan indefinite number of arguments, must be used at the end of the argument list
258-
=========================== =================================================================================================
263+
InputArgument::IS_ARRAYThe argument can can containan 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)

[8]ページ先頭

©2009-2025 Movatter.jp