Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Y
yii2bootstrap
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
夏彬
yii2bootstrap
Commits
23b44e60
Commit
23b44e60
authored
Nov 26, 2014
by
Alexander Makarov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes #4146: Added `yii\bootstrap\ButtonDropdown::$containerOptions`
parent
4207021e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
2 deletions
+17
-2
ButtonDropdown.php
ButtonDropdown.php
+16
-2
CHANGELOG.md
CHANGELOG.md
+1
-0
No files found.
ButtonDropdown.php
View file @
23b44e60
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
namespace
yii\bootstrap
;
namespace
yii\bootstrap
;
use
yii\helpers\ArrayHelper
;
use
yii\helpers\Html
;
use
yii\helpers\Html
;
/**
/**
...
@@ -37,6 +38,15 @@ class ButtonDropdown extends Widget
...
@@ -37,6 +38,15 @@ class ButtonDropdown extends Widget
* @var string the button label
* @var string the button label
*/
*/
public
$label
=
'Button'
;
public
$label
=
'Button'
;
/**
* @var array the HTML attributes for the container tag. The following special options are recognized:
*
* - tag: string, defaults to "div", the name of the container tag.
*
* @see \yii\helpers\Html::renderTagAttributes() for details on how attributes are being rendered.
* @since 2.0.1
*/
public
$containerOptions
=
[];
/**
/**
* @var array the HTML attributes of the button.
* @var array the HTML attributes of the button.
* @see \yii\helpers\Html::renderTagAttributes() for details on how attributes are being rendered.
* @see \yii\helpers\Html::renderTagAttributes() for details on how attributes are being rendered.
...
@@ -65,10 +75,14 @@ class ButtonDropdown extends Widget
...
@@ -65,10 +75,14 @@ class ButtonDropdown extends Widget
*/
*/
public
function
run
()
public
function
run
()
{
{
echo
Html
::
beginTag
(
'div'
,
[
'class'
=>
'btn-group'
]);
Html
::
addCssClass
(
$this
->
containerOptions
,
'btn-group'
);
$options
=
$this
->
containerOptions
;
$tag
=
ArrayHelper
::
remove
(
$options
,
'tag'
,
'div'
);
echo
Html
::
beginTag
(
$tag
,
$this
->
containerOptions
);
echo
"
\n
"
.
$this
->
renderButton
();
echo
"
\n
"
.
$this
->
renderButton
();
echo
"
\n
"
.
$this
->
renderDropdown
();
echo
"
\n
"
.
$this
->
renderDropdown
();
echo
"
\n
"
.
Html
::
endTag
(
'div'
);
echo
"
\n
"
.
Html
::
endTag
(
$tag
);
$this
->
registerPlugin
(
'button'
);
$this
->
registerPlugin
(
'button'
);
}
}
...
...
CHANGELOG.md
View file @
23b44e60
...
@@ -6,6 +6,7 @@ Yii Framework 2 bootstrap extension Change Log
...
@@ -6,6 +6,7 @@ Yii Framework 2 bootstrap extension Change Log
-
Bug #5570:
`yii\bootstrap\Tabs`
would throw an exception if
`content`
is not set for one of its
`items`
(RomeroMsk)
-
Bug #5570:
`yii\bootstrap\Tabs`
would throw an exception if
`content`
is not set for one of its
`items`
(RomeroMsk)
-
Bug #6150:
`yii\bootstrap\Tabs`
dropdown IDs were generated incorrectly (samdark)
-
Bug #6150:
`yii\bootstrap\Tabs`
dropdown IDs were generated incorrectly (samdark)
-
Enh #4146: Added
`yii\bootstrap\ButtonDropdown::$containerOptions`
(samdark)
-
Enh #4181: Added
`yii\bootstrap\Modal::$headerOptions`
and
`yii\bootstrap\Modal::$footerOptions`
(tuxoff, samdark)
-
Enh #4181: Added
`yii\bootstrap\Modal::$headerOptions`
and
`yii\bootstrap\Modal::$footerOptions`
(tuxoff, samdark)
-
Enh #4450: Added
`yii\bootstrap\Nav::renderDropdown()`
(qiangxue)
-
Enh #4450: Added
`yii\bootstrap\Nav::renderDropdown()`
(qiangxue)
-
Enh #5735: Added
`yii\bootstrap\Tabs::renderTabContent`
to support manually rendering tab contents (RomeroMsk)
-
Enh #5735: Added
`yii\bootstrap\Tabs::renderTabContent`
to support manually rendering tab contents (RomeroMsk)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment