braincrafted / bootstrap-bundle

BraincraftedBootstrapBundle integrates Bootstrap into Symfony2 by providing templates, Twig extensions, services and commands.
http://bootstrap.braincrafted.com
MIT License
399 stars 184 forks source link

Input Group Button Id #444

Open fabionvs opened 8 years ago

fabionvs commented 8 years ago

Hello guys, I am developing using Symfony 2.8 and rendering forms using braincrafted. I am searching the best alternative to change input group button id on form type, but I couldn't find any solution.

->add('imagem', 'text', array( 'attr' => array( 'help_text' => 'Select Image.', 'input_group' => array( 'id' => 'test', 'prepend' => '.fa-image', 'button_append' => array( 'name' => 'Select Image', 'type' => 'button', 'options' => ['button_class' => 'primary', 'attr' => ['id' => 'test']] ), ) ) ))

Option 'Button Append' uses id as the same as name by default. And that is terrible! Button HTML Output: <button type="button" id="Select Image" name="Select Image" class="btn btn-primary">Select Image</button>

screenshot 2016-06-20 08 52 19

Could anyone help me to solve this problem?