phpfriends / console-questionnaire
控制台应用程序的问卷调查
0.1.1
2016-11-13 21:47 UTC
Requires
- php: >=5.6
- symfony/console: @stable
- symfony/stopwatch: @stable
- symfony/translation: ^3.1
- symfony/yaml: @stable
- twig/twig: @stable
Requires (Dev)
- behat/behat: @stable
- bruli/php-git-hooks: @stable
- friendsofphp/php-cs-fixer: @stable
- mayflower/php-codebrowser: @stable
- pdepend/pdepend: @stable
- phploc/phploc: @stable
- phpmd/phpmd: @stable
- phpunit/php-code-coverage: @stable
- phpunit/phpcov: @stable
- phpunit/phpunit: @stable
- sebastian/phpcpd: @stable
- squizlabs/php_codesniffer: @stable
This package is not auto-updated.
Last update: 2024-09-18 19:54:11 UTC
README
控制台应用程序的问卷调查
(www.pskel.tk)[由 Pskel 于 2016-11-12 10:17:12 生成的 Readme]
它是如何工作的?
问题数组
$questions = [
1 => [
'key' => 'name',
'statement' => 'What\'s your name',
],
2 => [
'key' => 'age',
'statement' => 'What\'t your age range',
'options' => [
'< 18',
'18-39',
'> 39',
],
],
// ...
];
方法 questionsLoop
需要一个问题数组和另一个存储结果的数组。此外,这个结果数组应包含当前值。
例如
$data = [
'name' => 'John Doe',
'age' => '18-39',
// ...
];
这是一个可以玩耍的示例
➜ ConsoleQuestionnaire git:(master) ✗ src/console demo
[1] What's your name [John Doe]
[2] What't your age range [18-39]
// ...
[X] exit
select_option [X] ?
翻译
在问题中使用直接消息,你可以使用键。
感谢
- keeguon 对其国家列表汇编的贡献
https://gist.github.com/keeguon/2310008