Skip to content

Commit 4acb5b9

Browse files
committed
Update InputGroup to use Bootstrap classes
1 parent 049f980 commit 4acb5b9

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/TypiCMS/BootForms/Elements/InputGroup.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ public function type($type)
3131
return $this;
3232
}
3333

34-
protected function renderAddons($addons)
34+
protected function renderAddons($addons, $class)
3535
{
3636
$html = '';
3737

3838
foreach ($addons as $addon) {
39-
$html .= '<span class="input-group-addon">';
39+
$html .= sprintf('<span class="input-group-%s">', $class);
4040
$html .= $addon;
4141
$html .= '</span>';
4242
}
@@ -47,9 +47,9 @@ protected function renderAddons($addons)
4747
public function render()
4848
{
4949
$html = '<div class="input-group">';
50-
$html .= $this->renderAddons($this->beforeAddon);
50+
$html .= $this->renderAddons($this->beforeAddon, 'prepend');
5151
$html .= parent::render();
52-
$html .= $this->renderAddons($this->afterAddon);
52+
$html .= $this->renderAddons($this->afterAddon, 'append');
5353
$html .= '</div>';
5454

5555
return $html;

0 commit comments

Comments
 (0)