Jump to:

10928 Posts in 2612 Topics by 1809 members

All other Modules

SilverStripe Forums » All other Modules » User Defined Forms customisation

Discuss all other Modules here.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 632 Views
  • kuenkuen82
    Avatar
    Community Member
    41 Posts

    User Defined Forms customisation Link to this post

    I've created a form field, which is just Yes/No

    class EditableYesNoField extends EditableMultipleOptionField {
       
       static $singular_name = 'Yes/No Field';
       
       static $plural_name = 'Yes/No Fields';
       

       function getFormField() {
          $optionSet = $this->Options();
          $options = array('yes' => 'Yes', 'no' => 'No');
          
          /*if($optionSet) {
             foreach( $optionSet as $option ) {
                $options[$option->Title] = $option->Title;
             }   
          }*/
          
          return new OptionsetField($this->Name, $this->Title, $options);
       }
    }

    This works fine but how do I create a group of them?

    Attached Files
    632 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.