silverstripe-userforms/code/model/formfields/EditableRadioField.php

29 lines
564 B
PHP
Raw Normal View History

<?php
/**
* EditableRadioField
*
* Represents a set of selectable radio buttons
*
* @package userforms
*/
class EditableRadioField extends EditableMultipleOptionField {
private static $singular_name = 'Radio field';
private static $plural_name = 'Radio fields';
public function getFormField() {
$optionSet = $this->Options();
$options = array();
if($optionSet) {
foreach( $optionSet as $option ) {
2013-06-04 07:20:03 +02:00
$options[$option->EscapedTitle] = $option->Title;
}
}
return new OptionsetField($this->Name, $this->Title, $options);
}
}