Go to the source code of this file.
◆ show_the_same_modal_with_different_buttons()
show_the_same_modal_with_different_buttons |
( |
| ) |
|
Definition at line 2 of file show_the_same_modal_with_different_buttons.php.
3{
6 $renderer =
$DIC->ui()->renderer();
7
8 $modal =
$factory->modal()->roundtrip(
'My Modal 1',
$factory->legacy(
'My Content'))
9 ->withActionButtons([
10 $factory->button()->primary(
'Primary Action',
''),
11 $factory->button()->standard(
'Secondary Action',
''),
12 ]);
13
15 $button1 =
$factory->button()->standard(
'Open Modal 1',
'#')
16 ->withOnClick($modal->getShowSignal());
17 $out .=
' ' . $renderer->render($button1);
18
19 $button2 = $button1->withLabel('Also opens modal 1');
20 $out .=
' ' . $renderer->render($button2);
21
22 $button3 = $button2->withLabel('Does not open modal 1')
23 ->withResetTriggeredSignals();
24 $out .=
' ' . $renderer->render($button3);
25
26 return $out . $renderer->render($modal);
27}
References $DIC, $factory, and $out.