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.
References $DIC, $factory, and $out.
6 $renderer = $DIC->ui()->renderer();
8 $modal =
$factory->modal()->roundtrip(
'My Modal 1',
$factory->legacy(
'My Content'))
10 $factory->button()->primary(
'Primary Action',
''),
11 $factory->button()->standard(
'Secondary Action',
''),
15 $button1 =
$factory->button()->standard(
'Open Modal 1',
'#')
16 ->withOnClick($modal->getShowSignal());
17 $out .=
' ' . $renderer->render($button1);
19 $button2 = $button1->withLabel(
'Also opens modal 1');
20 $out .=
' ' . $renderer->render($button2);
22 $button3 = $button2->withLabel(
'Does not open modal 1')
23 ->withResetTriggeredSignals();
24 $out .=
' ' . $renderer->render($button3);
26 return $out . $renderer->render($modal);