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