質問編集履歴
1
タイトル修正
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
【Symfony3系】
|
1
|
+
【Symfony3系】FormでDialogを出現させたい
|
test
CHANGED
@@ -1,69 +1,13 @@
|
|
1
1
|
Symfony3系についての質問です。
|
2
2
|
|
3
|
-
Symfony3系にはQuestion Helperが用意されています。→[Question Helper](http://symfony.com/doc/current/components/console/helpers/questionhelper.html)
|
4
|
-
|
5
|
-
ただ使い方がよくわからずに困っております。
|
6
|
-
|
7
|
-
|
3
|
+
自分はFormのaddEventListenerで特定のFormに対してある条件を満たさなかった場合にダイアログを出現させたいと思っているのですが、わからず躓いている状況です。
|
8
|
-
|
9
|
-
どのタイミングで、どのような値を用意しなければならないのか…
|
10
4
|
|
11
5
|
|
12
6
|
|
13
|
-
```PHP
|
14
|
-
|
15
|
-
// ...
|
16
|
-
|
17
|
-
use Symfony\Component\Console\Input\InputInterface;
|
18
|
-
|
19
|
-
use Symfony\Component\Console\Output\OutputInterface;
|
20
|
-
|
21
|
-
|
7
|
+
Dialog Helperは3系ではすでに廃止されています。→[Dialog Helper](http://symfony.com/doc/current/components/console/helpers/dialoghelper.html)
|
22
8
|
|
23
9
|
|
24
10
|
|
25
|
-
class YourCommand extends Command
|
26
|
-
|
27
|
-
{
|
28
|
-
|
29
|
-
// ...
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
public function execute(InputInterface $input, OutputInterface $output)
|
34
|
-
|
35
|
-
{
|
36
|
-
|
37
|
-
$helper = $this->getHelper('question');
|
38
|
-
|
39
|
-
$question = new ConfirmationQuestion('Continue with this action?', false);
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
if (!$helper->ask($input, $output, $question)) {
|
44
|
-
|
45
|
-
return;
|
46
|
-
|
47
|
-
}
|
48
|
-
|
49
|
-
}
|
50
|
-
|
51
|
-
}
|
52
|
-
|
53
|
-
```
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
そのため上記のようなexecute関数の呼び出し方もわからない感じです。
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
自分はFormのaddEventListenerで特定のFormに対してある条件を満たさなかった場合にダイアログを出現させたいと思っているのですが、使い方がわからず躓いている状況です。
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
$input、$outputにはどういったものが入るのでしょうか?
|
66
|
-
|
67
|
-
|
11
|
+
良い方法がありましたらよろしくお願いいたします。
|
68
12
|
|
69
13
|
よろしくお願いいたします。
|