Skip to content

Commit 1a31cdd

Browse files
committed
Update artisan.md
1 parent ac12ca4 commit 1a31cdd

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

artisan.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -228,22 +228,22 @@ Artisan是包含在Laravel中命令行界面的名字。 它提供了很多有
228228
//
229229
}
230230

231-
#### Giving The User A Choice
231+
#### 给用户一个选择
232232

233-
The `anticipate` method can be used to provided autocompletion for possible choices. The user can still choose any answer, regardless of the choices.
233+
`anticipate`方法用来为可能的选择做自动填充。用户仍然可以填任何答案而无视这些选项。
234234

235235
$name = $this->anticipate('What is your name?', ['Taylor', 'Dayle']);
236236

237-
If you need to give the user a predefined set of choices, you may use the `choice` method. The user chooses the index of the answer, but the value of the answer will be returned to you. You may set the default value to be returned if nothing is chosen:
237+
如果你需要让用户必须从给定的选项中选,你可以使用`choice`方法。用户选择答案的索引,但答案的值返回给你。你可以设定返回默认值如果什么都没有选的话:
238238

239239
$name = $this->choice('What is your name?', ['Taylor', 'Dayle'], false);
240240

241241
<a name="writing-output"></a>
242-
### Writing Output
242+
### 编写输出
243243

244-
To send output to the console, use the `info`, `comment`, `question` and `error` methods. Each of these methods will use the appropriate ANSI colors for their purpose.
244+
使用`info`,`comment`,`question``error`方法,可以发送输出到命令行。这些方法中的每一个都会根据他们的目的使用合适的ANSI颜色来显示。
245245

246-
To display an information message to the user, use the `info` method. Typically, this will display in the console as green text:
246+
使用`info`方法来显示信息。一般情况下,在命令行中会显示为绿色文本:
247247

248248
/**
249249
* Execute the console command.
@@ -255,11 +255,11 @@ To display an information message to the user, use the `info` method. Typically,
255255
$this->info('Display this on the screen');
256256
}
257257

258-
To display an error message, use the `error` method. Error message text is typically displayed in red:
258+
使用`error`方法来显示错误信息。一般情况下,在命令行中会显示为红色文本:
259259

260260
$this->error('Something went wrong!');
261261

262-
#### Table Layouts
262+
#### 表格布局
263263

264264
The `table` method makes it easy to correctly format multiple rows / columns of data. Just pass in the headers and rows to the method. The width and height will be dynamically calculated based on the given data:
265265

0 commit comments

Comments
 (0)