Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
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
PSDI Army
yii2
Commits
6b95b2ad
Commit
6b95b2ad
authored
Dec 23, 2013
by
Pavel Agalecky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added support for tagName and encodeLabel parameters in ButtonDropdown
parent
c04e6507
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
4 deletions
+11
-4
ButtonDropdown.php
extensions/yii/bootstrap/ButtonDropdown.php
+10
-4
CHANGELOG.md
extensions/yii/bootstrap/CHANGELOG.md
+1
-0
No files found.
extensions/yii/bootstrap/ButtonDropdown.php
View file @
6b95b2ad
...
...
@@ -49,6 +49,14 @@ class ButtonDropdown extends Widget
* @var boolean whether to display a group of split-styled button group.
*/
public
$split
=
false
;
/**
* @var string the tag to use to render the button
*/
public
$tagName
=
'button'
;
/**
* @var boolean whether the label should be HTML-encoded.
*/
public
$encodeLabel
=
true
;
/**
...
...
@@ -68,7 +76,6 @@ class ButtonDropdown extends Widget
{
Html
::
addCssClass
(
$this
->
options
,
'btn'
);
if
(
$this
->
split
)
{
$tag
=
'button'
;
$options
=
$this
->
options
;
$this
->
options
[
'data-toggle'
]
=
'dropdown'
;
Html
::
addCssClass
(
$this
->
options
,
'dropdown-toggle'
);
...
...
@@ -78,7 +85,6 @@ class ButtonDropdown extends Widget
'options'
=>
$this
->
options
,
]);
}
else
{
$tag
=
'a'
;
$this
->
label
.=
' <span class="caret"></span>'
;
$options
=
$this
->
options
;
if
(
!
isset
(
$options
[
'href'
]))
{
...
...
@@ -89,10 +95,10 @@ class ButtonDropdown extends Widget
$splitButton
=
''
;
}
return
Button
::
widget
([
'tagName'
=>
$t
ag
,
'tagName'
=>
$t
his
->
tagName
,
'label'
=>
$this
->
label
,
'options'
=>
$options
,
'encodeLabel'
=>
false
,
'encodeLabel'
=>
$this
->
encodeLabel
,
])
.
"
\n
"
.
$splitButton
;
}
...
...
extensions/yii/bootstrap/CHANGELOG.md
View file @
6b95b2ad
...
...
@@ -7,6 +7,7 @@ Yii Framework 2 bootstrap extension Change Log
-
Enh #1474: Added option to make NavBar 100% width (cebe)
-
Enh #1553: Only add navbar-default class to NavBar when no other class is specified (cebe)
-
Bug #1459: Update Collapse to use bootstrap 3 classes (tonydspaniard)
-
Enh: Added support for tagName and encodeLabel parameters in ButtonDropdown (omnilight)
2.
0.0 alpha, December 1, 2013
-----------------------------
...
...
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