{"action":"closed","issue":{"url":"https://api.github.com/repos/kartik-v/yii2-widget-activeform/issues/110","repository_url":"https://api.github.com/repos/kartik-v/yii2-widget-activeform","labels_url":"https://api.github.com/repos/kartik-v/yii2-widget-activeform/issues/110/labels{/name}","comments_url":"https://api.github.com/repos/kartik-v/yii2-widget-activeform/issues/110/comments","events_url":"https://api.github.com/repos/kartik-v/yii2-widget-activeform/issues/110/events","html_url":"https://github.com/kartik-v/yii2-widget-activeform/issues/110","id":358079684,"node_id":"MDU6SXNzdWUzNTgwNzk2ODQ=","number":110,"title":"Unnesessary label in checkbox","user":{"login":"DarthLegiON","id":11365194,"node_id":"MDQ6VXNlcjExMzY1MTk0","avatar_url":"https://avatars2.githubusercontent.com/u/11365194?v=4","gravatar_id":"","url":"https://api.github.com/users/DarthLegiON","html_url":"https://github.com/DarthLegiON","followers_url":"https://api.github.com/users/DarthLegiON/followers","following_url":"https://api.github.com/users/DarthLegiON/following{/other_user}","gists_url":"https://api.github.com/users/DarthLegiON/gists{/gist_id}","starred_url":"https://api.github.com/users/DarthLegiON/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DarthLegiON/subscriptions","organizations_url":"https://api.github.com/users/DarthLegiON/orgs","repos_url":"https://api.github.com/users/DarthLegiON/repos","events_url":"https://api.github.com/users/DarthLegiON/events{/privacy}","received_events_url":"https://api.github.com/users/DarthLegiON/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-09-07T14:02:31Z","updated_at":"2018-09-07T16:29:54Z","closed_at":"2018-09-07T16:29:54Z","author_association":"NONE","body":"## Steps to reproduce the issue\r\n\r\nI use such code to generate checkboxes in my project forms\r\n```php\r\n$form->field($model, 'fieldName')->checkbox()->label(false); // last is optional\r\n```\r\n\r\n## Expected behavior and actual behavior\r\n\r\nExpected:\r\n```html\r\n<div class=\"form-group field-myform-fieldname\">\r\n    <div class=\"checkbox\">\r\n        <input type=\"hidden\" name=\"MyForm[fieldName]\" value=\"0\">\r\n        <label>\r\n            <input type=\"checkbox\" id=\"myform-fieldname\" name=\"MyForm[fieldName]\" value=\"1\"> Checkbox label\r\n        </label>\r\n    </div>\r\n    <div class=\"help-block\"></div>\r\n</div>\r\n```\r\n\r\nActual:\r\n```html\r\n<div class=\"form-group field-myform-fieldname\">\r\n    <label class=\"control-label\" for=\"myform-fieldname\"></label>  <!-- Redundant code, appends ugly white space -->  \r\n    <div class=\"checkbox\">\r\n        <input type=\"hidden\" name=\"MyForm[fieldName]\" value=\"0\">\r\n        <label>\r\n            <input type=\"checkbox\" id=\"myform-fieldname\" name=\"MyForm[fieldName]\" value=\"1\"> Checkbox label\r\n        </label>\r\n    </div>\r\n    <div class=\"help-block\"></div>\r\n</div>\r\n```\r\n\r\nI suppose it is something about templates, but there is no `label` in `checkTemplate`, ActiveField uses `template` for this. I use Bootstrap v3 and don't want to manually change templates in all my project forms, it could be very difficult. I should revert plugin update for now and wait for a solution, thanks!\r\n\r\n<bountysource-plugin>\r\n\r\n---\r\nWant to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/63129411-unnesessary-label-in-checkbox?utm_campaign=plugin&utm_content=tracker%2F8180036&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F8180036&utm_medium=issues&utm_source=github).\r\n</bountysource-plugin>"}}
{"actor":{"display_login":"DarthLegiON"}}