Hello, I am trying to create a dynamic configuration of my block:
example:
$value = array(45, 18, 98);
for ($i = 0; $i < count($value); $i++) {
$valor = 'config_text' . $value[$i];
$title = "Title text " . $value[$i];
$mform->addElement('text', $valor, $title);
$mform->setDefault($valor, 'default value');
$mform->setType($valor, PARAM_RAW);
}
But this doesn't work, form fields are displayed but values are not saved, any ideas, thanks.