Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Input Group Button Support #287

Merged
merged 2 commits into from
Aug 15, 2014

Conversation

rdohms
Copy link
Contributor

@rdohms rdohms commented Aug 14, 2014

Added a new Extension to allow people to append buttons to inputs as well as
icons. Will add examples to the docs repo also. But this is what it looks
like:

$builder
           ->add('keywords', 'text', [
                   'label' => false,
                   'attr' => array(
                       'input_group' => array(
                           'button_append' => ['name' => 'search', 'type' =>
'submit']
                       )
                   )
               ]);

This closes #250.

Added a new Extension to allow people to append buttons to inputs as well as icons.
Will add examples to the docs repo also. But this is what it looks like:

```
$builder
            ->add('keywords', 'text', [
                    'label' => false,
                    'attr' => array(
                        'input_group' => array(
                            'btn_append' => ['name' => 'search', 'type' => 'submit']
                        )
                    )
                ]);
```
@florianeckerstorfer
Copy link
Member

Wow, thanks.

I am only thinking that it may would be better to use button instead of btn in the PHP and Twig names.

@rdohms
Copy link
Contributor Author

rdohms commented Aug 14, 2014

I can do that, hang on.

Renaming all btn references to button.
@rdohms
Copy link
Contributor Author

rdohms commented Aug 14, 2014

Done.

@rdohms
Copy link
Contributor Author

rdohms commented Aug 15, 2014

Any other considerations?

florianeckerstorfer pushed a commit that referenced this pull request Aug 15, 2014
@florianeckerstorfer florianeckerstorfer merged commit 413c414 into braincrafted:develop Aug 15, 2014
@florianeckerstorfer
Copy link
Member

Nope, this is great.

@psylosss
Copy link

Is it possible to set custom CSS-class to this appended button?


SOLVED: via options key, like 'options' => ['attr' => ['class' => 'btn btn-info']]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support buttons in input groups
3 participants