Skip to content

Input Group Button Support#287

Merged
florianeckerstorfer merged 2 commits intobraincrafted:developfrom
rdohms:input-group-buttons
Aug 15, 2014
Merged

Input Group Button Support#287
florianeckerstorfer merged 2 commits intobraincrafted:developfrom
rdohms:input-group-buttons

Conversation

@rdohms
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor Author

rdohms commented Aug 14, 2014

I can do that, hang on.

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

rdohms commented Aug 14, 2014

Done.

@rdohms
Copy link
Copy Markdown
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
Copy Markdown
Member

Nope, this is great.

@psylosss
Copy link
Copy Markdown

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