prepareVars(); return $this->makePartial('~/modules/backend/widgets/form/partials/_field_dropdown.htm'); } /** * Prepares the view data */ public function prepareVars() { $this->vars['field'] = $this->makeFormField(); } protected function makeFormField(): FormField { $field = clone $this->formField; $field->type = 'dropdown'; $field->options = $this->getOptions(); return $field; } protected function getOptions(): array { return Menu::listInTheme(Theme::getEditTheme(), true) ->mapWithKeys(function ($menu) { return [ $menu->code => $menu->name, ]; })->toArray(); } }