Skip to content
Snippets Groups Projects
Commit d9010511 authored by Lucas García's avatar Lucas García
Browse files

feat: protected setting_name getter

parent aa071a97
No related branches found
No related tags found
1 merge request!3Git submodules
Subproject commit a42bd3980028ac038ad883e909c1275472cecc59
Subproject commit 4388d7c035f4dc968443fafe64582e6bbf471373
......@@ -115,11 +115,12 @@ class Settings extends BaseSettings
private function render_forms_dropdown($setting, $field, $value)
{
$setting_name = $this->setting_name($setting);
$forms = self::get_forms();
$options = array_merge(['<option value=""></option>'], array_map(function ($form) use ($value) {
$selected = $form->id == $value ? 'selected' : '';
return "<option value='{$form->id}' {$selected}>{$form->title}</option>";
}, $forms));
return "<select name='{$setting}[{$field}]'>" . implode('', $options) . '</select>';
return "<select name='{$setting_name}[{$field}]'>" . implode('', $options) . '</select>';
}
}
Subproject commit f625b3c83f952ff5e2d7c9d10453bab2bed146e3
Subproject commit 98b6d9e3729ef61c1c7fafd73e23f793633d2062
Subproject commit dfda2d8fc482fc8c8ccbd6e44f77578edd11d88b
Subproject commit 198c261d40fd41f0e0c3419ec18f5e7644766cb4
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment