Commit 511535ec by Denis M Committed by Alexander Makarov

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

parent 4b97abac
...@@ -44,10 +44,22 @@ class Modal extends Widget ...@@ -44,10 +44,22 @@ class Modal extends Widget
*/ */
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.
*/ */
public $size; public $size;
...@@ -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;
} }
......
...@@ -20,6 +20,7 @@ Yii Framework 2 Change Log ...@@ -20,6 +20,7 @@ Yii Framework 2 Change Log
- Bug #5925: `ArrayHelper::htmlEncode()` does not work properly when the value being encoded is a nested array (tebazil) - Bug #5925: `ArrayHelper::htmlEncode()` does not work properly when the value being encoded is a nested array (tebazil)
- Bug: Gii console command help information does not contain global options (qiangxue) - Bug: Gii console command help information does not contain global options (qiangxue)
- Bug: `yii\web\UrlRule` was unable to create URLs for rules containing unicode characters (samdark) - Bug: `yii\web\UrlRule` was unable to create URLs for rules containing unicode characters (samdark)
- Enh #4181: Added `yii\bootstrap\Modal::$headerOptions` and `yii\bootstrap\Modal::$footerOptions` (tuxoff, samdark)
- Enh #4263: Added migration and SQL schema files for `yii\log\DbTarget` (samdark) - Enh #4263: Added migration and SQL schema files for `yii\log\DbTarget` (samdark)
- Enh #4457: Added support for using noscript for css files registered through asset bundles and Html helper (samdark) - Enh #4457: Added support for using noscript for css files registered through asset bundles and Html helper (samdark)
- Enh #5223: Query builder now supports selecting sub-queries as columns (qiangxue) - Enh #5223: Query builder now supports selecting sub-queries as columns (qiangxue)
......
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