Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F99187426
PHUILeftRightExample.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
Wed, Jan 22, 04:10
Size
1 KB
Mime Type
text/x-php
Expires
Fri, Jan 24, 04:10 (2 d)
Engine
blob
Format
Raw Data
Handle
23717454
Attached To
rPH Phabricator
PHUILeftRightExample.php
View Options
<?php
final
class
PHUILeftRightExample
extends
PhabricatorUIExample
{
public
function
getName
()
{
return
pht
(
'Responsive left-right table'
);
}
public
function
getDescription
()
{
return
pht
(
'Allows easily alignment of left/right UI elements.'
);
}
public
function
renderExample
()
{
$request
=
$this
->
getRequest
();
$user
=
$request
->
getUser
();
$text
=
pht
(
'This is a sample of some text.'
);
$button
=
id
(
new
PHUIButtonView
())
->
setTag
(
'a'
)
->
setText
(
pht
(
'Actions'
))
->
setIcon
(
'fa-bars'
);
$content1
=
id
(
new
PHUILeftRightView
())
->
setLeft
(
$text
)
->
setRight
(
$button
)
->
setVerticalAlign
(
PHUILeftRightView
::
ALIGN_TOP
);
$content2
=
id
(
new
PHUILeftRightView
())
->
setLeft
(
$text
)
->
setRight
(
$button
)
->
setVerticalAlign
(
PHUILeftRightView
::
ALIGN_MIDDLE
);
$content3
=
id
(
new
PHUILeftRightView
())
->
setLeft
(
$text
)
->
setRight
(
$button
)
->
setVerticalAlign
(
PHUILeftRightView
::
ALIGN_BOTTOM
);
$head2
=
id
(
new
PHUIHeaderView
())
->
setHeader
(
'Align Top'
)
->
addClass
(
'ml'
);
$head3
=
id
(
new
PHUIHeaderView
())
->
setHeader
(
pht
(
'Align Middle'
))
->
addClass
(
'ml'
);
$head4
=
id
(
new
PHUIHeaderView
())
->
setHeader
(
pht
(
'Align Bottom'
))
->
addClass
(
'ml'
);
$wrap2
=
id
(
new
PHUIBoxView
())
->
appendChild
(
$content1
)
->
addMargin
(
PHUI
::
MARGIN_LARGE
);
$wrap3
=
id
(
new
PHUIBoxView
())
->
appendChild
(
$content2
)
->
addMargin
(
PHUI
::
MARGIN_LARGE
);
$wrap4
=
id
(
new
PHUIBoxView
())
->
appendChild
(
$content3
)
->
addMargin
(
PHUI
::
MARGIN_LARGE
);
return
array
(
$head2
,
$wrap2
,
$head3
,
$wrap3
,
$head4
,
$wrap4
,
);
}
}
Event Timeline
Log In to Comment