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 Feb 10, 2023
1 parent 866ad61 commit d71eb75
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 @@ -105,6 +105,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 d71eb75

Please sign in to comment.