Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93043638
PHUIBoxExample.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
Mon, Nov 25, 18:56
Size
2 KB
Mime Type
text/x-php
Expires
Wed, Nov 27, 18:56 (2 d)
Engine
blob
Format
Raw Data
Handle
22560985
Attached To
rPH Phabricator
PHUIBoxExample.php
View Options
<?php
final
class
PHUIBoxExample
extends
PhabricatorUIExample
{
public
function
getName
()
{
return
'Box'
;
}
public
function
getDescription
()
{
return
'It
\'
s a fancy or non-fancy box. Put stuff in it.'
;
}
public
function
renderExample
()
{
$content1
=
'Asmund and Signy'
;
$content2
=
'The Cottager and his Cat'
;
$content3
=
'Geirlug The King
\'
s Daughter'
;
$layout1
=
array
(
id
(
new
PHUIBoxView
())
->
appendChild
(
$content1
),
id
(
new
PHUIBoxView
())
->
appendChild
(
$content2
),
id
(
new
PHUIBoxView
())
->
appendChild
(
$content3
));
$layout2
=
array
(
id
(
new
PHUIBoxView
())
->
appendChild
(
$content1
)
->
addMargin
(
PHUI
::
MARGIN_SMALL_LEFT
),
id
(
new
PHUIBoxView
())
->
appendChild
(
$content2
)
->
addMargin
(
PHUI
::
MARGIN_MEDIUM_LEFT
)
->
addMargin
(
PHUI
::
MARGIN_MEDIUM_TOP
),
id
(
new
PHUIBoxView
())
->
appendChild
(
$content3
)
->
addMargin
(
PHUI
::
MARGIN_LARGE_LEFT
)
->
addMargin
(
PHUI
::
MARGIN_LARGE_TOP
));
$layout3
=
array
(
id
(
new
PHUIBoxView
())
->
appendChild
(
$content1
)
->
setShadow
(
true
)
->
addPadding
(
PHUI
::
PADDING_SMALL
)
->
addMargin
(
PHUI
::
MARGIN_LARGE_BOTTOM
),
id
(
new
PHUIBoxView
())
->
appendChild
(
$content2
)
->
setShadow
(
true
)
->
addPadding
(
PHUI
::
PADDING_MEDIUM
)
->
addMargin
(
PHUI
::
MARGIN_LARGE_BOTTOM
),
id
(
new
PHUIBoxView
())
->
appendChild
(
$content3
)
->
setShadow
(
true
)
->
addPadding
(
PHUI
::
PADDING_LARGE
)
->
addMargin
(
PHUI
::
MARGIN_LARGE_BOTTOM
));
$head1
=
id
(
new
PHUIHeaderView
())
->
setHeader
(
pht
(
'Plain Box'
));
$head2
=
id
(
new
PHUIHeaderView
())
->
setHeader
(
pht
(
'Plain Box with space'
));
$head3
=
id
(
new
PHUIHeaderView
())
->
setHeader
(
pht
(
'Shadow Box with space'
));
$wrap1
=
id
(
new
PHUIBoxView
())
->
appendChild
(
$layout1
)
->
addMargin
(
PHUI
::
MARGIN_LARGE
);
$wrap2
=
id
(
new
PHUIBoxView
())
->
appendChild
(
$layout2
)
->
addMargin
(
PHUI
::
MARGIN_LARGE
);
$wrap3
=
id
(
new
PHUIBoxView
())
->
appendChild
(
$layout3
)
->
addMargin
(
PHUI
::
MARGIN_LARGE
);
return
phutil_tag
(
'div'
,
array
(),
array
(
$head1
,
$wrap1
,
$head2
,
$wrap2
,
$head3
,
$wrap3
));
}
}
Event Timeline
Log In to Comment