neilime / zf2-twb-bundle

Zend Framework module for easy integration of Twitter Bootstrap
http://neilime.github.io/zf2-twb-bundle/
MIT License
143 stars 94 forks source link

Ability to show label in inline-form #189

Closed alexz707 closed 7 years ago

alexz707 commented 7 years ago

hi! thanks for this cool project, keep it up! I just wanted to render a horizontal form with an inline form fieldset. Like in the attached screenshot. This works but I want to show the labels in the inline form which is currently not possible. I looked into the code TwBundleFormRow and

Could you please add an option to show the labes (so it will remove the sr-only class). I think it could be done in the TwBundleFormRow class around line 219.

What do you think about that? Or is it possible and I didn't see it??

alex

bildschirmfoto 2017-01-24 um 21 55 51
neilime commented 7 years ago

Hi, It's not possible at the moment. Your solution to add an option that does not set the class "sr-only" sounds good to me. Can you make a pull request ?

alexz707 commented 7 years ago

hi! thanks for the response. I will make a PR but before we should have a look at another problem. I tried to run the tests you provided but many of them failed. The reason is simple in the library you use PHP_EOL which checks the OS and uses \n or \r\n. In your testcase files you have only \r\n so when if u run the tests on macOs or Linux they will fail.

I came up with two solutions:

We change the content which should be checked by assertStringEqualsFile (just replace \n with \r\n ) or we change the PHP_EOL in the library to a static \n (or \r\n) and change the testfiles.

What do you think about it ?

alexz707 commented 7 years ago

I tried both versions but the only solution which looks good to me is to change to \n in the library. In my pull request there is the new feature as well as the new tests. Hope travis is fine with that..

neilime commented 7 years ago

Pull request added in version v3.0.5