Skip to content
This repository has been archived by the owner on Aug 9, 2022. It is now read-only.

Commit

Permalink
Merge pull request #123 from mobydimk/master
Browse files Browse the repository at this point in the history
add suffix and prefix options for select
  • Loading branch information
dwightwatson committed Mar 2, 2019
2 parents 2a26d17 + 1da6175 commit b6e1566
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/BootstrapForm.php
Expand Up @@ -736,8 +736,18 @@ public function select($name, $label = null, $list = [], $selected = null, array
{
$label = $this->getLabelTitle($label, $name);

$inputElement = isset($options['prefix']) ? $options['prefix'] : '';

$options = $this->getFieldOptions($options, $name);
$inputElement = $this->form->select($name, $list, $selected, $options);
$inputElement .= $this->form->select($name, $list, $selected, $options);

if (isset($options['suffix'])) {
$inputElement .= $options['suffix'];
}

if (isset($options['prefix']) || isset($options['suffix'])) {
$inputElement = '<div class="input-group">' . $inputElement . '</div>';
}

$wrapperOptions = $this->isHorizontal() ? ['class' => $this->getRightColumnClass()] : [];
$wrapperElement = '<div' . $this->html->attributes($wrapperOptions) . '>' . $inputElement . $this->getFieldError($name) . $this->getHelpText($name, $options) . '</div>';
Expand Down

0 comments on commit b6e1566

Please sign in to comment.