Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F436719
PhabricatorButtonsExample.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
PhabricatorButtonsExample.php
View Options
<?php
final
class
PhabricatorButtonsExample
extends
PhabricatorUIExample
{
public
function
getName
()
{
return
'Buttons'
;
}
public
function
getDescription
()
{
return
'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_render_tag
(
$tag
,
array
(
'class'
=>
$class
,
),
phutil_escape_html
(
ucwords
(
$size
.
' '
.
$color
.
' '
.
$tag
)));
$view
[]
=
'<br /><br />'
;
}
}
}
return
'<div style="margin: 1em 2em;">'
.
implode
(
''
,
$view
).
'</div>'
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sun, May 4, 12:10 AM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
62826
Default Alt Text
PhabricatorButtonsExample.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment