Silverstripe UserForms - fills in parameters from DataObject

I am very new to Silverstripe,

In the CMS page, I can add a dropdown item and I can see that I can create options. BUT. What I want to do is populate the dropdown from the array. How can i do this?

The array will look something like this:

$dropdownFields = array(
  'option1' => array(lots of emails),
  'option2' => array(lots of emails),
  'option3' => array(lots of emails),
  etc
)

      

I think what I want is for me to have a DataObject with an "option" field and a "text" field where the emails were entered in CSV format.

But how can I get the UserForms dropdown menu to retrieve the parameter values ​​from the DataObject and not as user input via cms ...

+3


source to share


1 answer


You cannot achieve this through a CMS and only a module. To do this, you need to create a custom EditableFormField

.



Subclass this and make the necessary changes: https://github.com/silverstripe/silverstripe-userforms/blob/master/code/model/formfields/EditableDropdown.php

+2


source







All Articles