{"action":"created","issue":{"url":"https://api.github.com/repos/bcit-ci/CodeIgniter/issues/3893","labels_url":"https://api.github.com/repos/bcit-ci/CodeIgniter/issues/3893/labels{/name}","comments_url":"https://api.github.com/repos/bcit-ci/CodeIgniter/issues/3893/comments","events_url":"https://api.github.com/repos/bcit-ci/CodeIgniter/issues/3893/events","html_url":"https://github.com/bcit-ci/CodeIgniter/pull/3893","id":84747285,"number":3893,"title":"made all form helpers consistent regarding extra attributes","user":{"login":"darkhouse","id":286036,"avatar_url":"https://avatars.githubusercontent.com/u/286036?v=3","gravatar_id":"","url":"https://api.github.com/users/darkhouse","html_url":"https://github.com/darkhouse","followers_url":"https://api.github.com/users/darkhouse/followers","following_url":"https://api.github.com/users/darkhouse/following{/other_user}","gists_url":"https://api.github.com/users/darkhouse/gists{/gist_id}","starred_url":"https://api.github.com/users/darkhouse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/darkhouse/subscriptions","organizations_url":"https://api.github.com/users/darkhouse/orgs","repos_url":"https://api.github.com/users/darkhouse/repos","events_url":"https://api.github.com/users/darkhouse/events{/privacy}","received_events_url":"https://api.github.com/users/darkhouse/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-06-03T20:02:22Z","updated_at":"2015-06-08T14:56:10Z","closed_at":"2015-06-08T12:19:25Z","pull_request":{"url":"https://api.github.com/repos/bcit-ci/CodeIgniter/pulls/3893","html_url":"https://github.com/bcit-ci/CodeIgniter/pull/3893","diff_url":"https://github.com/bcit-ci/CodeIgniter/pull/3893.diff","patch_url":"https://github.com/bcit-ci/CodeIgniter/pull/3893.patch"},"body":"Extra attributes in form methods can now all be passed as arrays or strings, form_dropdown and form_open already behaved that way."},"comment":{"url":"https://api.github.com/repos/bcit-ci/CodeIgniter/issues/comments/110024809","html_url":"https://github.com/bcit-ci/CodeIgniter/pull/3893#issuecomment-110024809","issue_url":"https://api.github.com/repos/bcit-ci/CodeIgniter/issues/3893","id":110024809,"user":{"login":"narfbg","id":1058011,"avatar_url":"https://avatars.githubusercontent.com/u/1058011?v=3","gravatar_id":"","url":"https://api.github.com/users/narfbg","html_url":"https://github.com/narfbg","followers_url":"https://api.github.com/users/narfbg/followers","following_url":"https://api.github.com/users/narfbg/following{/other_user}","gists_url":"https://api.github.com/users/narfbg/gists{/gist_id}","starred_url":"https://api.github.com/users/narfbg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/narfbg/subscriptions","organizations_url":"https://api.github.com/users/narfbg/orgs","repos_url":"https://api.github.com/users/narfbg/repos","events_url":"https://api.github.com/users/narfbg/events{/privacy}","received_events_url":"https://api.github.com/users/narfbg/received_events","type":"User","site_admin":false},"created_at":"2015-06-08T14:56:10Z","updated_at":"2015-06-08T14:56:10Z","body":"If you ask me, `form_dropdown()` is the only *useful* \"form helper\", as it does make a lot of heavy lifting for you, while with the rest of them you just write PHP code instead of HTML, but with no functional benefit ...\r\n\r\nBut anyway, you're arguing in favor of the \"extra\" parameter, yet you're giving examples without it ...\r\n\r\n    form_input('name', set_value('name')) // short and sweet\r\n    form_input(array('name' => 'name', 'value' => set_value('name')) // almost double the code\r\n\r\nNow, this looks a lot more different:\r\n\r\n    form_input('name', set_value('name'), array('class' => 'foo', 'id' => 'bar');\r\n    form_input(array('name' => 'name', 'value' => set_value('name'), 'class' => 'foo', 'id' => 'bar'));\r\n\r\nYou can argue that the first one is shorter, but you're also using \"consistency\" as an argument and everything in one array is way more consistent than three parameters working in many different ways under multiple conditions. Not to mention the maintenance cost that comes with this.\r\n\r\nNobody is saying that you wouldn't still be able to use `form_open('name', 'value')`, but if you want to pass an array of attributes ... I think I've already made my point about that."}}