覆盖表单模板Symfony2,twig元素?

Spl*_*nia 2 forms overriding widget symfony twig

我正在尝试覆盖某些表单的模板.

这是其中之一

  public function buildForm(FormBuilder $builder, array $options)
    {
        $builder
            ->add('nombreBD','text', array( 'required' => true, 'label' => 'Nombre Base de Datos: '))
            ->add('Servidor','choice', array(
                            'choices'   => array('1' => 'Si', '0' => 'No'),
                            'required'  => true,
                            'multiple'  => false,
                            'expanded'  => true,
                            'label' => 'Servidor Existente?',

                  ))
            ->add('ServidorBD','entity',
                  array ('class' => 'MonseWebBundle:ServidoresBD',
                        'multiple' => true, 
                        'required' => true, 
                        'label' => 'Servidor de Base de Datos: ',
                         'query_builder' => function(EntityRepository $er) {
                         return $er->createQueryBuilder('u')
                         ->orderBy('u.url', 'ASC');
                                                                           },
                         ))
            ;
    }
Run Code Online (Sandbox Code Playgroud)

这就是模板

{% block text_widget %}
<div class="round full-width-input" id="full-width-input">
    <input type="text" {{ block('attributes') }} value="{{ value }}" >
</div>
{% endblock %}
Run Code Online (Sandbox Code Playgroud)

我想我在文本输入中取得了成功,但我不知道如何设置实体和单选按钮(选项),因为我不知道信息的存储位置.例如,我不太清楚什么块('attributes')和{{value}]返回.同样我不知道如何选择无线电按钮.

我想用这个:

<label for="dropdown-actions">Dropdown</label>

                                    <select id="dropdown-actions">
                                        <option value="option1">Select your action here</option>
                                    </select>
Run Code Online (Sandbox Code Playgroud)

对于实体"ServidoresBD"而言:

<label for="selected-radio" class="alt-label"><input type="radio" id="selected-radio" checked="checked" />A selected radio</label>
                                        <label for="unselected-radio" class="alt-label"><input type="radio" id="unselected-radio" />An uselected radio</label>
Run Code Online (Sandbox Code Playgroud)

对于单选按钮.

此外,由于一个奇怪的原因,所有项目中的所有标签都显示为大写,无论我把它们放在什么样的风格.总是,这真的很烦人.

任何帮助将不胜感激.

ege*_*oen 7

默认表单主题存储在Twig桥下.在这里,您可以找到表单主题中定义的所有块.

只需看看这个文件和IMO,你就会明白你需要做什么.:)

希望有所帮助.