Commit fb67f958 by Alexander Makarov

More cases for #4595

parent b1e20900
...@@ -55,7 +55,7 @@ class Alert extends Widget ...@@ -55,7 +55,7 @@ class Alert extends Widget
/** /**
* @var array the options for rendering the close button tag. * @var array the options for rendering the close button tag.
* The close button is displayed in the header of the modal window. Clicking * The close button is displayed in the header of the modal window. Clicking
* on the button will hide the modal window. If this is null, no close button will be rendered. * on the button will hide the modal window. If this is false, no close button will be rendered.
* *
* The following special options are supported: * The following special options are supported:
* *
...@@ -117,7 +117,7 @@ class Alert extends Widget ...@@ -117,7 +117,7 @@ class Alert extends Widget
*/ */
protected function renderCloseButton() protected function renderCloseButton()
{ {
if ($this->closeButton !== null) { if ($this->closeButton !== false) {
$tag = ArrayHelper::remove($this->closeButton, 'tag', 'button'); $tag = ArrayHelper::remove($this->closeButton, 'tag', 'button');
$label = ArrayHelper::remove($this->closeButton, 'label', '×'); $label = ArrayHelper::remove($this->closeButton, 'label', '×');
if ($tag === 'button' && !isset($this->closeButton['type'])) { if ($tag === 'button' && !isset($this->closeButton['type'])) {
......
...@@ -11,7 +11,12 @@ Yii Framework 2 bootstrap extension Change Log ...@@ -11,7 +11,12 @@ Yii Framework 2 bootstrap extension Change Log
- Enh #4120: Added ability for each item to choose it's encoding option in `Dropdown` and `Nav` (Alex-Code) - Enh #4120: Added ability for each item to choose it's encoding option in `Dropdown` and `Nav` (Alex-Code)
- Enh #4363: Added `showIndicators` property to make Carousel indicators optional (sdkiller) - Enh #4363: Added `showIndicators` property to make Carousel indicators optional (sdkiller)
- Chg #3036: Upgraded Twitter Bootstrap to 3.1.x (qiangxue) - Chg #3036: Upgraded Twitter Bootstrap to 3.1.x (qiangxue)
- Chg #4595: `yii\bootstrap\NavBar`'s `brandLabel` and `brandUrl` are taking `false` instead of `null` for "don't use" case (samdark) - Chg #4595: The following properties are now taking `false` instead of `null` for "don't use" case (samdark)
- `yii\bootstrap\NavBar::$brandLabel`.
- `yii\bootstrap\NavBar::$brandUrl`.
- `yii\bootstrap\Modal::$closeButton`.
- `yii\bootstrap\Modal::$toggleButton`.
- `yii\bootstrap\Alert::$closeButton`.
2.0.0-beta April 13, 2014 2.0.0-beta April 13, 2014
------------------------- -------------------------
......
...@@ -52,9 +52,9 @@ class Modal extends Widget ...@@ -52,9 +52,9 @@ class Modal extends Widget
*/ */
public $size; public $size;
/** /**
* @var array the options for rendering the close button tag. * @var array|false the options for rendering the close button tag.
* The close button is displayed in the header of the modal window. Clicking * The close button is displayed in the header of the modal window. Clicking
* on the button will hide the modal window. If this is null, no close button will be rendered. * on the button will hide the modal window. If this is false, no close button will be rendered.
* *
* The following special options are supported: * The following special options are supported:
* *
...@@ -69,7 +69,7 @@ class Modal extends Widget ...@@ -69,7 +69,7 @@ class Modal extends Widget
/** /**
* @var array the options for rendering the toggle button tag. * @var array the options for rendering the toggle button tag.
* The toggle button is used to toggle the visibility of the modal window. * The toggle button is used to toggle the visibility of the modal window.
* If this property is null, no toggle button will be rendered. * If this property is false, no toggle button will be rendered.
* *
* The following special options are supported: * The following special options are supported:
* *
...@@ -80,7 +80,7 @@ class Modal extends Widget ...@@ -80,7 +80,7 @@ class Modal extends Widget
* Please refer to the [Modal plugin help](http://getbootstrap.com/javascript/#modals) * Please refer to the [Modal plugin help](http://getbootstrap.com/javascript/#modals)
* for the supported HTML attributes. * for the supported HTML attributes.
*/ */
public $toggleButton; public $toggleButton = false;
/** /**
...@@ -187,7 +187,7 @@ class Modal extends Widget ...@@ -187,7 +187,7 @@ class Modal extends Widget
*/ */
protected function renderCloseButton() protected function renderCloseButton()
{ {
if ($this->closeButton !== null) { if ($this->closeButton !== false) {
$tag = ArrayHelper::remove($this->closeButton, 'tag', 'button'); $tag = ArrayHelper::remove($this->closeButton, 'tag', 'button');
$label = ArrayHelper::remove($this->closeButton, 'label', '×'); $label = ArrayHelper::remove($this->closeButton, 'label', '×');
if ($tag === 'button' && !isset($this->closeButton['type'])) { if ($tag === 'button' && !isset($this->closeButton['type'])) {
...@@ -217,7 +217,7 @@ class Modal extends Widget ...@@ -217,7 +217,7 @@ class Modal extends Widget
$this->clientOptions = array_merge(['show' => false], $this->clientOptions); $this->clientOptions = array_merge(['show' => false], $this->clientOptions);
} }
if ($this->closeButton !== null) { if ($this->closeButton !== false) {
$this->closeButton = array_merge([ $this->closeButton = array_merge([
'data-dismiss' => 'modal', 'data-dismiss' => 'modal',
'aria-hidden' => 'true', 'aria-hidden' => 'true',
...@@ -225,7 +225,7 @@ class Modal extends Widget ...@@ -225,7 +225,7 @@ class Modal extends Widget
], $this->closeButton); ], $this->closeButton);
} }
if ($this->toggleButton !== null) { if ($this->toggleButton !== false) {
$this->toggleButton = array_merge([ $this->toggleButton = array_merge([
'data-toggle' => 'modal', 'data-toggle' => 'modal',
], $this->toggleButton); ], $this->toggleButton);
......
...@@ -181,6 +181,13 @@ new ones save the following code as `convert.php` that should be placed in the s ...@@ -181,6 +181,13 @@ new ones save the following code as `convert.php` that should be placed in the s
will return `images/logo.png` directly. If you want a relative URL to be prefix with base URL, you should make use will return `images/logo.png` directly. If you want a relative URL to be prefix with base URL, you should make use
of the alias `@web`. For example, `Url::to('@web/images/logo.png')` will return `/BaseUrl/images/logo.png`. of the alias `@web`. For example, `Url::to('@web/images/logo.png')` will return `/BaseUrl/images/logo.png`.
* `yii\bootstrap\NavBar`'s `brandLabel` and `brandUrl` are taking `false` instead of `null` for "don't use" case. - The following properties are now taking `false` instead of `null` for "don't use" case:
- `yii\bootstrap\NavBar::$brandLabel`.
* `yii\widgets\LinkPager`'s `nextPageLabel`, `prevPageLabel`, `firstPageLabel`, `lastPageLabel` are now taking `false` instead of `null` for "no label". - `yii\bootstrap\NavBar::$brandUrl`.
- `yii\bootstrap\Modal::$closeButton`.
- `yii\bootstrap\Modal::$toggleButton`.
- `yii\bootstrap\Alert::$closeButton`.
- `yii\widgets\LinkPager::$nextPageLabel`.
- `yii\widgets\LinkPager::$prevPageLabel`.
- `yii\widgets\LinkPager::$firstPageLabel`.
- `yii\widgets\LinkPager::$lastPageLabel`.
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