Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F434458
AphrontFormCheckboxControl.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
AphrontFormCheckboxControl.php
View Options
<?php
final
class
AphrontFormCheckboxControl
extends
AphrontFormControl
{
private
$boxes
=
array
();
public
function
addCheckbox
(
$name
,
$value
,
$label
,
$checked
=
false
,
$id
=
null
)
{
$this
->
boxes
[]
=
array
(
'name'
=>
$name
,
'value'
=>
$value
,
'label'
=>
$label
,
'checked'
=>
$checked
,
'id'
=>
$id
,
);
return
$this
;
}
protected
function
getCustomControlClass
()
{
return
'aphront-form-control-checkbox'
;
}
protected
function
renderInput
()
{
$rows
=
array
();
foreach
(
$this
->
boxes
as
$box
)
{
$id
=
idx
(
$box
,
'id'
);
if
(
$id
===
null
)
{
$id
=
celerity_generate_unique_node_id
();
}
$checkbox
=
phutil_tag
(
'input'
,
array
(
'id'
=>
$id
,
'type'
=>
'checkbox'
,
'name'
=>
$box
[
'name'
],
'value'
=>
$box
[
'value'
],
'checked'
=>
$box
[
'checked'
]
?
'checked'
:
null
,
'disabled'
=>
$this
->
getDisabled
()
?
'disabled'
:
null
,
));
$label
=
phutil_tag
(
'label'
,
array
(
'for'
=>
$id
,
),
$box
[
'label'
]);
$rows
[]
=
phutil_tag
(
'tr'
,
array
(),
array
(
phutil_tag
(
'td'
,
array
(),
$checkbox
),
phutil_tag
(
'th'
,
array
(),
$label
),
));
}
return
phutil_tag
(
'table'
,
array
(
'class'
=>
'aphront-form-control-checkbox-layout'
),
$rows
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, May 3, 5:30 PM (1 d, 13 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
61314
Default Alt Text
AphrontFormCheckboxControl.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment