{"action":"created","issue":{"url":"https://api.github.com/repos/phalcon/cphalcon/issues/1815","repository_url":"https://api.github.com/repos/phalcon/cphalcon","labels_url":"https://api.github.com/repos/phalcon/cphalcon/issues/1815/labels{/name}","comments_url":"https://api.github.com/repos/phalcon/cphalcon/issues/1815/comments","events_url":"https://api.github.com/repos/phalcon/cphalcon/issues/1815/events","html_url":"https://github.com/phalcon/cphalcon/issues/1815","id":25559481,"number":1815,"title":"[NFR] Phalcon\\Tag to allow setting element attributes, name and id, to be optional","user":{"login":"qevo","id":6396974,"avatar_url":"https://avatars0.githubusercontent.com/u/6396974?v=4","gravatar_id":"","url":"https://api.github.com/users/qevo","html_url":"https://github.com/qevo","followers_url":"https://api.github.com/users/qevo/followers","following_url":"https://api.github.com/users/qevo/following{/other_user}","gists_url":"https://api.github.com/users/qevo/gists{/gist_id}","starred_url":"https://api.github.com/users/qevo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qevo/subscriptions","organizations_url":"https://api.github.com/users/qevo/orgs","repos_url":"https://api.github.com/users/qevo/repos","events_url":"https://api.github.com/users/qevo/events{/privacy}","received_events_url":"https://api.github.com/users/qevo/received_events","type":"User","site_admin":false},"labels":[{"id":13573146,"url":"https://api.github.com/repos/phalcon/cphalcon/labels/New%20Feature%20Request","name":"New Feature Request","color":"0052cc","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2014-01-14T08:34:33Z","updated_at":"2018-04-17T07:54:03Z","closed_at":null,"author_association":"NONE","body":"##   Current behavior\n\nVarious elements in Phalcon\\Tag automatically set the element attributes, name and id, unless one is provided for in the params. \n##   Desired behavior\n\nAbility to render all Phalcon\\Tag elements without attributes name or id.\n##   Reason\n\nHTML element IDs are global in the HTML Document Object Model (DOM). They should be set purposefully to avoid collisions in JavaScript and CSS. \n## Proof\n\nAutomatically sets name and id attributes\n\n``` php\nPhalcon\\Tag::textField( array( 'someName' ) );\n//returns\n<input name=\"someName\" id=\"someName\" value=\"\" type=\"text\" />\n```\n\n**Forces default name. Forces id, but allows empty value.**\n\n``` php\nPhalcon\\Tag::textField( array( 'someName', 'name' => '', 'id' => '' ) );\n//returns\n<input name=\"someName\" id=\"\" value=\"\" type=\"text\" />\n```\n\n(I noticed this comment in C code. It convinced me to stop testing my PHP. https://github.com/phalcon/cphalcon/blob/master/ext/tag.c#L610)\n## Possible solution\n\nCurrently the Phalcon\\Tag::\\* requires either a string with the name or an array whose first value is a string with the name of the element. If array is used, all values after the first must be a key-value pair (associative array), where they are transposed into the tag attributes, otherwise they are ignored.\n\nChecks could be added to the parameters evaluation process and commands communicated via string (as opposed to key-value pair) value in the array.\n\n``` php\nPhalcon\\Tag::textField( array( 'someName', 'noId', 'noName' ) );\n//returns\n<input value=\"\" type=\"text\" />\n```\n## <bountysource-plugin>\n\nWant to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/1896293-nfr-phalcon-tag-to-allow-setting-element-attributes-name-and-id-to-be-optional?utm_campaign=plugin&utm_content=tracker%2F50707&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F50707&utm_medium=issues&utm_source=github).\n</bountysource-plugin>\n"},"comment":{"url":"https://api.github.com/repos/phalcon/cphalcon/issues/comments/381886135","html_url":"https://github.com/phalcon/cphalcon/issues/1815#issuecomment-381886135","issue_url":"https://api.github.com/repos/phalcon/cphalcon/issues/1815","id":381886135,"user":{"login":"stale[bot]","id":26384082,"avatar_url":"https://avatars3.githubusercontent.com/in/1724?v=4","gravatar_id":"","url":"https://api.github.com/users/stale%5Bbot%5D","html_url":"https://github.com/apps/stale","followers_url":"https://api.github.com/users/stale%5Bbot%5D/followers","following_url":"https://api.github.com/users/stale%5Bbot%5D/following{/other_user}","gists_url":"https://api.github.com/users/stale%5Bbot%5D/gists{/gist_id}","starred_url":"https://api.github.com/users/stale%5Bbot%5D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stale%5Bbot%5D/subscriptions","organizations_url":"https://api.github.com/users/stale%5Bbot%5D/orgs","repos_url":"https://api.github.com/users/stale%5Bbot%5D/repos","events_url":"https://api.github.com/users/stale%5Bbot%5D/events{/privacy}","received_events_url":"https://api.github.com/users/stale%5Bbot%5D/received_events","type":"Bot","site_admin":false},"created_at":"2018-04-17T07:54:03Z","updated_at":"2018-04-17T07:54:03Z","author_association":"NONE","body":"Thank you for contributing to this issue. As it has been 90 days since the last activity, we are automatically closing the issue. This is often because the request was already solved in some way and it just wasn't updated or it's no longer applicable. If that's not the case, please feel free to either reopen this issue or open a new one. We will be more than happy to look at it again! You can read more here: https://blog.phalconphp.com/post/github-closing-old-issues\n"}}
{"actor":{"display_login":"stale"}}