Skip to content

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

3 participants