Skip to content

Commit

Permalink
Merge pull request #1 from dmstr/feature/customizable-button-tag-name
Browse files Browse the repository at this point in the history
button tag name
  • Loading branch information
schmunk42 authored Jan 20, 2022
2 parents 0ee34e4 + d220f43 commit ebfb574
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CookieButton.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ class CookieButton extends \yii\bootstrap\Widget
*/
public $cookie = [];

/**
* @var string the tag to use to render the button
*/
public $buttonTagName = 'button';

/**
* @var string the button type setting (i.e. button or switch).
*/
Expand Down Expand Up @@ -134,6 +139,7 @@ private function renderButton()
'label' => $this->encodeLabel ? Html::encode($this->label) : $this->label,
'encodeLabel' => $this->encodeLabel,
'options' => ArrayHelper::merge(['data-toggle' => 'button'], $this->options),
'tagName' => $this->buttonTagName
]);
}

Expand Down

0 comments on commit ebfb574

Please sign in to comment.