Version: current

     1 <?php
     2 /**
     3  * EditableDropdown
     4  *
     5  * Represents a modifiable dropdown (select) box on a form
     6  *
     7  * @package userforms
     8  */
     9
    10 class EditableDropdown extends EditableMultipleOptionField {
    11
    12     static $singular_name = 'Dropdown Field';
    13
    14     static $plural_name = 'Dropdowns';
    15
    16     /**
    17      * @return DropdownField
    18      */
    19     function getFormField() {
    20         $optionSet = $this->Options();
    21         $options = array();
    22
    23         if($optionSet) {
    24             foreach($optionSet as $option) {
    25                 $options[$option->Title] = $option->Title;
    26             }
    27         }
    28
    29         return new DropdownField($this->Name, $this->Title, $options);
    30     }
    31 }

[Raise a SilverStripe Framework issue/bug](https://github.com/silverstripe/silverstripe-framework/issues/new)
- [Raise a SilverStripe CMS issue/bug](https://github.com/silverstripe/silverstripe-cms/issues/new)
- Please use the Silverstripe Forums to ask development related questions. -