Skip to content

Commit

Permalink
prepare multi dropdown for Behat testing
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek committed Oct 10, 2022
1 parent 4be8a3c commit 0b6fae9
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions demos/form-control/dropdown-plus.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,36 @@
'values' => ['default' => 'Default', 'option1' => 'Option 1', 'option2' => 'Option 2'],
]);

$htmlValues = ['default' => 'default <a>', 's' => 'simple', 'foo <b>' => 'bar <b>'];

$form->addControl('html_single', [
Form\Control\Dropdown::class,
'caption' => 'HTML single',
'values' => $htmlValues,
]);

$form->addControl('html_single2', [
Form\Control\Dropdown::class,
'caption' => 'HTML single allow addition',
'values' => $htmlValues,
'dropdownOptions' => ['allowAdditions' => true],
]);

$form->addControl('html_multi', [
Form\Control\Dropdown::class,
'caption' => 'HTML multiple',
'isMultiple' => true,
'values' => $htmlValues,
]);

$form->addControl('html_multi2', [
Form\Control\Dropdown::class,
'caption' => 'HTML multiple allow addition',
'isMultiple' => true,
'values' => $htmlValues,
'dropdownOptions' => ['allowAdditions' => true],
]);

$form->onSubmit(function (Form $form) use ($app) {
$message = $app->encodeJson($form->model->get());

Expand Down

0 comments on commit 0b6fae9

Please sign in to comment.