Exemplo n.º 1
0
 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);
     }
 }
Exemplo n.º 2
0
 protected function getInputProps()
 {
     $props = parent::getInputProps();
     $props['_first_option'] = $this->get('_element')->get(Specs::FIRST_CHOICE);
     $props['_options'] = $this->get('_element')->get(Specs::CHOICES);
     return $props;
 }
Exemplo n.º 3
0
 protected function addInputIdAttribute(AbstractWidget $tag, Renderer $renderer)
 {
     if (!$tag->getInput()->get('id')) {
         $tag->getInput()->set('for', $this->getFormIdPrefix($tag, $renderer));
     }
 }
Exemplo n.º 4
0
 protected function getInputProps()
 {
     $props = parent::getInputProps();
     $props['value'] = $this->get('_element')->get(Specs::CHECKED_VALUE);
     return $props;
 }