protected function translateInputOptions(AbstractWidget $tag, Renderer $renderer) { $input = $tag->getInput(); if ($input && $input->get('_first_option')) { $newOption = $this->getStringTranslation($input->get('_first_option'), $renderer->getOption('language')); $input->set('_first_option', $newOption); } if ($input && $input->get('_options')) { $newOptions = []; foreach ($input->get('_options') as $k => $v) { $newOptions[$k] = $this->getStringTranslation($v, $renderer->getOption('language')); } $input->set('_options', $newOptions); } }
protected function addInputIdAttribute(AbstractWidget $tag, Renderer $renderer) { if (!$tag->getInput()->get('id')) { $tag->getInput()->set('for', $this->getFormIdPrefix($tag, $renderer)); } }