public function block_choice_widget($context, array $blocks = array()) { // line 126 ob_start(); // line 127 echo " "; if ($this->getContext($context, 'expanded')) { // line 128 echo " <div "; echo $this->renderBlock("container_attributes", $context, $blocks); echo "> "; // line 129 $context['_parent'] = (array) $context; $context['_seq'] = twig_ensure_traversable($this->getContext($context, 'form')); foreach ($context['_seq'] as $context['choice'] => $context['child']) { // line 130 echo " "; echo $this->env->getExtension('form')->renderWidget($this->getContext($context, 'child')); echo " "; // line 131 echo $this->env->getExtension('form')->renderLabel($this->getContext($context, 'child')); echo " "; } $_parent = $context['_parent']; unset($context['_seq'], $context['_iterated'], $context['choice'], $context['child'], $context['_parent'], $context['loop']); $context = array_merge($_parent, array_intersect_key($context, $_parent)); // line 133 echo " </div> "; } else { // line 135 echo " <select "; echo $this->renderBlock("attributes", $context, $blocks); if ($this->getContext($context, 'multiple')) { echo " multiple=\"multiple\""; } echo "> "; // line 136 if ((!twig_test_none($this->getContext($context, 'empty_value')))) { // line 137 echo " <option value=\"\">"; echo twig_escape_filter($this->env, $this->env->getExtension('translator')->trans($this->getContext($context, 'empty_value')), "html"); echo "</option> "; } // line 139 echo " "; if ((twig_length_filter($this->env, $this->getContext($context, 'preferred_choices')) > 0)) { // line 140 echo " "; $context['options'] = $this->getContext($context, 'preferred_choices'); // line 141 echo " "; echo $this->renderBlock("options", $context, $blocks); echo " <option disabled=\"disabled\">"; // line 142 echo twig_escape_filter($this->env, $this->getContext($context, 'separator'), "html"); echo "</option> "; } // line 144 echo " "; $context['options'] = $this->getContext($context, 'choices'); // line 145 echo " "; echo $this->renderBlock("options", $context, $blocks); echo " </select> "; } echo trim(preg_replace('/>\s+</', '><', ob_get_clean())); }
public function block_choice_widget($context, array $blocks = array()) { // line 44 ob_start(); // line 45 echo " "; if ($this->getContext($context, 'expanded')) { // line 46 echo " <div "; $this->displayBlock('widget_container_attributes', $context, $blocks); echo ">\n "; // line 47 $context['_parent'] = (array) $context; $context['_seq'] = twig_ensure_traversable($this->getContext($context, 'form')); foreach ($context['_seq'] as $context['_key'] => $context['child']) { // line 48 echo " "; echo $this->env->getExtension('form')->renderWidget($this->getContext($context, 'child')); echo "\n "; // line 49 echo $this->env->getExtension('form')->renderLabel($this->getContext($context, 'child')); echo "\n "; } $_parent = $context['_parent']; unset($context['_seq'], $context['_iterated'], $context['_key'], $context['child'], $context['_parent'], $context['loop']); $context = array_merge($_parent, array_intersect_key($context, $_parent)); // line 51 echo " </div>\n "; } else { // line 53 echo " <select "; $this->displayBlock('widget_attributes', $context, $blocks); if ($this->getContext($context, 'multiple')) { echo " multiple=\"multiple\""; } echo ">\n "; // line 54 if (!twig_test_none($this->getContext($context, 'empty_value'))) { // line 55 echo " <option value=\"\">"; echo twig_escape_filter($this->env, $this->env->getExtension('translator')->trans($this->getContext($context, 'empty_value')), "html"); echo "</option>\n "; } // line 57 echo " "; if (twig_length_filter($this->env, $this->getContext($context, 'preferred_choices')) > 0) { // line 58 echo " "; $context['options'] = $this->getContext($context, 'preferred_choices'); // line 59 echo " "; $this->displayBlock('widget_choice_options', $context, $blocks); echo "\n "; // line 60 if (twig_length_filter($this->env, $this->getContext($context, 'choices')) > 0) { // line 61 echo " <option disabled=\"disabled\">"; echo twig_escape_filter($this->env, $this->getContext($context, 'separator'), "html"); echo "</option>\n "; } // line 63 echo " "; } // line 64 echo " "; $context['options'] = $this->getContext($context, 'choices'); // line 65 echo " "; $this->displayBlock('widget_choice_options', $context, $blocks); echo "\n </select>\n "; } echo trim(preg_replace('/>\\s+</', '><', ob_get_clean())); }