Last active
February 10, 2017 15:33
-
-
Save chrisguitarguy/5f51127a77288c824c02 to your computer and use it in GitHub Desktop.
How to use Bootstrap input groups (http://getbootstrap.com/components/#input-groups) in a Symfony form theme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% form_theme form 'theme.html.twig' %} | |
{# the theme above will take care of rendering the input group #} | |
{{ form(form) }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{# form_name will be the name of your form type #} | |
{# field_name is the name of the field #} | |
{# See http://symfony.com/doc/current/cookbook/form/form_customization.html#how-to-customize-an-individual-field #} | |
{% block _form_name_field_name_widget -%} | |
<div class="input-group"> | |
{{- block('form_widget_simple') -}} | |
<span class="input-group-btn"> | |
<button type="button" class="btn btn-default"> | |
Do Stuff | |
</button> | |
</span> | |
</div> | |
{%- endblock %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment