Skip to content

Commit

Permalink
Merge pull request #19 from ddinchev/master
Browse files Browse the repository at this point in the history
Allow moving the input addon to the start of the input.
  • Loading branch information
Eugene Terentev authored Nov 23, 2018
2 parents 9f636a2 + f0c0076 commit 0340f8a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/DateTimeWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,14 @@ class DateTimeWidget extends InputWidget
* @var
*/
public $momentDatetimeFormat;

/**
* @var bool
*/
public $showInputAddon = true;
/**
* @var bool show the input addon in the beginning of the input, not the end
*/
public $showInputAddonStart = false;
/**
* @var string
*/
Expand Down Expand Up @@ -140,9 +143,14 @@ public function run()
}
Html::addCssStyle($this->containerOptions, 'position: relative');
$content[] = Html::beginTag('div', $this->containerOptions);

if ($this->showInputAddon && $this->showInputAddonStart) {
$content[] = $this->renderInputAddon();
}

$content[] = $this->renderInput();

if ($this->showInputAddon) {
if ($this->showInputAddon && !$this->showInputAddonStart) {
$content[] = $this->renderInputAddon();
}

Expand Down

0 comments on commit 0340f8a

Please sign in to comment.