Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93171221
PHUIFormLayoutView.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
Tue, Nov 26, 18:17
Size
1 KB
Mime Type
text/x-php
Expires
Thu, Nov 28, 18:17 (2 d)
Engine
blob
Format
Raw Data
Handle
22586258
Attached To
rPH Phabricator
PHUIFormLayoutView.php
View Options
<?php
/**
* This provides the layout of an AphrontFormView without actually providing
* the <form /> tag. Useful on its own for creating forms in other forms (like
* dialogs) or forms which aren't submittable.
*/
final
class
PHUIFormLayoutView
extends
AphrontView
{
private
$classes
=
array
();
private
$fullWidth
;
public
function
setFullWidth
(
$width
)
{
$this
->
fullWidth
=
$width
;
return
$this
;
}
public
function
addClass
(
$class
)
{
$this
->
classes
[]
=
$class
;
return
$this
;
}
public
function
appendInstructions
(
$text
)
{
return
$this
->
appendChild
(
phutil_tag
(
'div'
,
array
(
'class'
=>
'aphront-form-instructions'
,
),
$text
));
}
public
function
appendRemarkupInstructions
(
$remarkup
)
{
$view
=
id
(
new
AphrontFormView
())
->
setViewer
(
$this
->
getViewer
())
->
newInstructionsRemarkupView
(
$remarkup
);
return
$this
->
appendInstructions
(
$view
);
}
public
function
render
()
{
$classes
=
$this
->
classes
;
$classes
[]
=
'phui-form-view'
;
if
(
$this
->
fullWidth
)
{
$classes
[]
=
'phui-form-full-width'
;
}
return
phutil_tag
(
'div'
,
array
(
'class'
=>
implode
(
' '
,
$classes
),
),
$this
->
renderChildren
());
}
}
Event Timeline
Log In to Comment