Commit f07e49c5 authored by Denis M's avatar Denis M Committed by Alexander Makarov

Fixes #4181: Added `yii\bootstrap\Modal::$headerOptions` and `yii\bootstrap\Modal::$footerOptions`

parent b0627800
...@@ -43,10 +43,22 @@ class Modal extends Widget ...@@ -43,10 +43,22 @@ class Modal extends Widget
* @var string the header content in the modal window. * @var string the header content in the modal window.
*/ */
public $header; public $header;
/**
* @var string additional header options
* @see \yii\helpers\Html::renderTagAttributes() for details on how attributes are being rendered.
* @since 2.0.1
*/
public $headerOptions;
/** /**
* @var string the footer content in the modal window. * @var string the footer content in the modal window.
*/ */
public $footer; public $footer;
/**
* @var string additional footer options
* @see \yii\helpers\Html::renderTagAttributes() for details on how attributes are being rendered.
* @since 2.0.1
*/
public $footerOptions;
/** /**
* @var string the modal size. Can be [[SIZE_LARGE]] or [[SIZE_SMALL]], or empty for default. * @var string the modal size. Can be [[SIZE_LARGE]] or [[SIZE_SMALL]], or empty for default.
*/ */
...@@ -125,7 +137,8 @@ class Modal extends Widget ...@@ -125,7 +137,8 @@ class Modal extends Widget
$this->header = $button . "\n" . $this->header; $this->header = $button . "\n" . $this->header;
} }
if ($this->header !== null) { if ($this->header !== null) {
return Html::tag('div', "\n" . $this->header . "\n", ['class' => 'modal-header']); Html::addCssClass($this->headerOptions, 'modal-header');
return Html::tag('div', "\n" . $this->header . "\n", $this->headerOptions);
} else { } else {
return null; return null;
} }
...@@ -156,7 +169,8 @@ class Modal extends Widget ...@@ -156,7 +169,8 @@ class Modal extends Widget
protected function renderFooter() protected function renderFooter()
{ {
if ($this->footer !== null) { if ($this->footer !== null) {
return Html::tag('div', "\n" . $this->footer . "\n", ['class' => 'modal-footer']); Html::addCssClass($this->footerOptions, 'modal-footer');
return Html::tag('div', "\n" . $this->footer . "\n", $this->footerOptions);
} else { } else {
return null; return null;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment