3 final class AphrontFormRadioButtonControl
extends AphrontFormControl
{
5 private $buttons = array();
7 public function addButton(
13 $this->buttons
[] = array(
16 'caption' => $caption,
18 'disabled' => $disabled,
23 protected function getCustomControlClass() {
24 return 'aphront-form-control-radio';
27 protected function renderInput() {
29 foreach ($this->buttons
as $button) {
30 $id = celerity_generate_unique_node_id();
36 'name' => $this->getName(),
37 'value' => $button['value'],
38 'checked' => ($button['value'] == $this->getValue())
41 'disabled' => ($this->getDisabled() ||
$button['disabled'])
49 'class' => $button['class'],
53 if ($button['caption']) {
56 phutil_tag_div('aphront-form-radio-caption', $button['caption']),
59 $rows[] = phutil_tag('tr', array(), array(
60 phutil_tag('td', array(), $radio),
61 phutil_tag('th', array(), $label),
67 array('class' => 'aphront-form-control-radio-layout'),