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
f651e723
Commit
f651e723
authored
May 29, 2013
by
Antonio Ramirez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactored label render
parent
3647c3f1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
4 deletions
+15
-4
Button.php
framework/yii/bootstrap/Button.php
+15
-4
No files found.
framework/yii/bootstrap/Button.php
View file @
f651e723
...
@@ -64,6 +64,10 @@ class Button extends Widget
...
@@ -64,6 +64,10 @@ class Button extends Widget
*/
*/
public
$label
;
public
$label
;
/**
/**
* @var array the HTML attributes of the button.
*/
public
$buttonOptions
=
array
();
/**
* @var array list of menu items in the dropdown. Each array element represents a single
* @var array list of menu items in the dropdown. Each array element represents a single
* menu with the following structure:
* menu with the following structure:
*
*
...
@@ -120,16 +124,23 @@ class Button extends Widget
...
@@ -120,16 +124,23 @@ class Button extends Widget
protected
function
renderLabel
()
protected
function
renderLabel
()
{
{
$label
=
$this
->
encodeLabels
?
Html
::
encode
(
$this
->
label
)
:
$this
->
label
;
$label
=
$this
->
encodeLabels
?
Html
::
encode
(
$this
->
label
)
:
$this
->
label
;
$options
=
array
(
'class'
=>
'btn dropdown-toggle'
,
'data-toggle'
=>
'dropdown'
);
$this
->
addCssClass
(
$this
->
buttonOptions
,
'btn'
);
$splitButton
=
''
;
if
(
$this
->
split
)
{
if
(
$this
->
split
)
{
$tag
=
'button'
;
$tag
=
'button'
;
$label
.=
Html
::
tag
(
'button'
,
'<span class="caret"></span>'
,
$options
);
$options
=
$this
->
buttonOptions
;
$options
=
array
(
'class'
=>
'btn'
);
$this
->
buttonOptions
[
'data-toggle'
]
=
'dropdown'
;
$this
->
addCssClass
(
$this
->
buttonOptions
,
'dropdown-toggle'
);
$splitButton
=
Html
::
tag
(
'button'
,
'<span class="caret"></span>'
,
$this
->
buttonOptions
);
}
else
{
}
else
{
$tag
=
'a'
;
$tag
=
'a'
;
$options
=
$this
->
buttonOptions
;
if
(
!
isset
(
$options
[
'href'
]))
{
$options
[
'href'
]
=
'#'
;
$options
[
'href'
]
=
'#'
;
}
}
return
Html
::
tag
(
$tag
,
$label
,
$options
);
$options
[
'data-toggle'
]
=
'dropdown'
;
}
return
Html
::
tag
(
$tag
,
$label
,
$options
)
.
"
\n
"
.
$splitButton
;
}
}
/**
/**
...
...
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