FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
phpfui/src/PHPFUI/SplitButton.php at master · phpfui/phpfui · GitHub
phpfui
/
phpfui
Public
Notifications
You must be signed in to change notification settings
Fork
1
Star
7
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
phpfui
/
src
/
PHPFUI
/
SplitButton.php
Copy path
More file actions
More file actions
Latest commit
History
History
History
59 lines (46 loc) · 1.13 KB
Breadcrumbs
phpfui
/
src
/
PHPFUI
/
SplitButton.php
Copy path
File metadata and controls
59 lines (46 loc) · 1.13 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php
namespace
PHPFUI
;
/**
* Simple SplitButton wrapper
*/
class
SplitButton
extends
\
PHPFUI
\Button
{
private
\
PHPFUI
\
Menu
$
menu
;
private
bool
$
started
=
false
;
public
function
__construct
(
string
$
text
,
string
$
link
)
{
\
PHPFUI
\HTML5Element::
__construct
(
'
div
'
);
$
this
->
addClass
(
'
button-group
'
);
$
this
->
add
(
new
\
PHPFUI
\
Button
(
$
text
,
$
link
));
$
this
->
menu
=
new
\
PHPFUI
\
Menu
();
}
public
function
addLink
(
string
$
link
,
string
$
name
) :
SplitButton
{
return
$
this
->
addMenuItem
(
new
\
PHPFUI
\
MenuItem
(
$
name
,
$
link
));
}
public
function
addMenuItem
(
MenuItem
$
item
) :
static
{
$
this
->
menu
->
addMenuItem
(
$
item
);
return
$
this
;
}
public
function
sort
() :
static
{
$
this
->
menu
->
sort
();
return
$
this
;
}
protected
function
getStart
() :
string
{
if
(!
$
this
->
started
)
{
$
this
->
started
=
true
;
$
dropDown
=
new
\
PHPFUI
\
DropDownButton
(
''
);
$
dropDown
->
addClass
(
'
arrow-only
'
);
foreach
(
$
this
->
menu
->
getMenuItems
()
as
$
item
)
{
$
dropDown
->
addMenuItem
(
$
item
);
}
$
this
->
add
(
$
dropDown
);
}
return
\
PHPFUI
\HTML5Element::
getStart
();
}
}
Back
|
FazBrowse Home
|
New Git URL