{"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":4,"created_at":"2015-06-03T20:02:22Z","updated_at":"2015-06-08T14:39:36Z","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/110018019","html_url":"https://github.com/bcit-ci/CodeIgniter/pull/3893#issuecomment-110018019","issue_url":"https://api.github.com/repos/bcit-ci/CodeIgniter/issues/3893","id":110018019,"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},"created_at":"2015-06-08T14:39:36Z","updated_at":"2015-06-08T14:39:36Z","body":"form_input('name', set_value('name')) // short and sweet\r\nform_input(array('name' => 'name', 'value' => set_value('name')) // almost double the code\r\n\r\nI think the ability to pass everything as an array is fine, but you're saying if you want to set a class on a field it's better to send everything as an array, which again, won't work on dropdowns, yet dropdown is the only input helper that already allows sending the $extra param as an array. \r\n\r\nWhat if I've already got a giant form in place using the \"short and sweet\" system, and now for some reason I have to add a class to a bunch of fields? I'd have to change the code for all those fields and move everything to an array rather than just adding the extra class on the end of them.\r\n\r\nI don't think having the $extra param is silly at all, I don't think sending it as an array is silly. The name and value params are mandatory, so they can stay as separate params. There's nothing wrong with tacking on an array of extra attributes for class, style, data-*, placeholder, etc. The idea here is that I think everything should be consistent. Dropdown already allows an array, form_open allows an array. Arrays are certainly cleaner code than messy strings, they should all allow arrays, or strings so you're not breaking existing forms.\r\n\r\nOf course, I can just use my own form helpers and not worry about adding this into the core but I really think this should be part of the core, and would be beneficial to a lot of people. I don't believe having the $extra param is a mistake, and I don't think passing it as an array is a bigger mistake. I think the idea of having to pass everything as an array just to add a class is silly."}}