Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93494671
PhabricatorButtonsExample.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Nov 29, 05:06
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Dec 1, 05:06 (2 d)
Engine
blob
Format
Raw Data
Handle
22653964
Attached To
rPH Phabricator
PhabricatorButtonsExample.php
View Options
<?php
final
class
PhabricatorButtonsExample
extends
PhabricatorUIExample
{
public
function
getName
()
{
return
'Buttons'
;
}
public
function
getDescription
()
{
return
hsprintf
(
'Use <tt><button></tt> to render buttons.'
);
}
public
function
renderExample
()
{
$request
=
$this
->
getRequest
();
$user
=
$request
->
getUser
();
$colors
=
array
(
''
,
'green'
,
'grey'
,
'black'
,
'disabled'
);
$sizes
=
array
(
''
,
'small'
);
$tags
=
array
(
'a'
,
'button'
);
$view
=
array
();
foreach
(
$tags
as
$tag
)
{
foreach
(
$colors
as
$color
)
{
foreach
(
$sizes
as
$size
)
{
$class
=
implode
(
' '
,
array
(
$color
,
$size
));
if
(
$tag
==
'a'
)
{
$class
.=
' button'
;
}
$view
[]
=
phutil_tag
(
$tag
,
array
(
'class'
=>
$class
,
),
ucwords
(
$size
.
' '
.
$color
.
' '
.
$tag
));
$view
[]
=
hsprintf
(
'<br /><br />'
);
}
}
}
return
phutil_tag
(
'div'
,
array
(
'style'
=>
'margin: 1em 2em;'
),
$view
);
}
}
Event Timeline
Log In to Comment