{"action":"created","issue":{"url":"https://api.github.com/repos/cakephp/cakephp/issues/7307","labels_url":"https://api.github.com/repos/cakephp/cakephp/issues/7307/labels{/name}","comments_url":"https://api.github.com/repos/cakephp/cakephp/issues/7307/comments","events_url":"https://api.github.com/repos/cakephp/cakephp/issues/7307/events","html_url":"https://github.com/cakephp/cakephp/issues/7307","id":103268913,"number":7307,"title":"3.x RFC Elements to be inside template's named folders (more like rails partials)","user":{"login":"Laykou","id":2313005,"avatar_url":"https://avatars.githubusercontent.com/u/2313005?v=3","gravatar_id":"","url":"https://api.github.com/users/Laykou","html_url":"https://github.com/Laykou","followers_url":"https://api.github.com/users/Laykou/followers","following_url":"https://api.github.com/users/Laykou/following{/other_user}","gists_url":"https://api.github.com/users/Laykou/gists{/gist_id}","starred_url":"https://api.github.com/users/Laykou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Laykou/subscriptions","organizations_url":"https://api.github.com/users/Laykou/orgs","repos_url":"https://api.github.com/users/Laykou/repos","events_url":"https://api.github.com/users/Laykou/events{/privacy}","received_events_url":"https://api.github.com/users/Laykou/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/cakephp/cakephp/labels/RFC","name":"RFC","color":"c7def8"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/cakephp/cakephp/milestones/2","html_url":"https://github.com/cakephp/cakephp/milestones/Future","labels_url":"https://api.github.com/repos/cakephp/cakephp/milestones/2/labels","id":453023,"number":2,"title":"Future","description":null,"creator":{"login":"lh-import","id":5175817,"avatar_url":"https://avatars.githubusercontent.com/u/5175817?v=3","gravatar_id":"","url":"https://api.github.com/users/lh-import","html_url":"https://github.com/lh-import","followers_url":"https://api.github.com/users/lh-import/followers","following_url":"https://api.github.com/users/lh-import/following{/other_user}","gists_url":"https://api.github.com/users/lh-import/gists{/gist_id}","starred_url":"https://api.github.com/users/lh-import/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lh-import/subscriptions","organizations_url":"https://api.github.com/users/lh-import/orgs","repos_url":"https://api.github.com/users/lh-import/repos","events_url":"https://api.github.com/users/lh-import/events{/privacy}","received_events_url":"https://api.github.com/users/lh-import/received_events","type":"User","site_admin":false},"open_issues":23,"closed_issues":262,"state":"open","created_at":"2013-10-11T20:37:33Z","updated_at":"2015-12-15T16:10:35Z","due_on":null,"closed_at":null},"comments":19,"created_at":"2015-08-26T13:22:37Z","updated_at":"2015-12-16T15:04:09Z","closed_at":null,"body":"This is just a little idea on how to improve the elements - to behave more like `partials` in Rails. Currently the\r\n```PHP\r\n// src/Template/Users/index.ctp\r\n$this->element('helpbox');\r\n```\r\nsearches for `Template/Element/helpbox.ctp`. But what if it could search for `Template/Users/_helpbox.ctp` first? So that the view files related to `Users` model are in the same directory. The file would start with an underscore to visually separate it from other templates. If no such file is found, then the `helpbox` would be searched in `Element` folder as it is now.\r\n\r\nAlso when called from other view file (inside other model name):\r\n```PHP\r\n// src/Template/Articles/view.ctp\r\n$this->element('Users/helpbox');\r\n```\r\nWould search for `Template/Users/_helpbox.ctp` and then for `Template/Element/Users/helpbox.ctp`?\r\n\r\nWhat do you think?"},"comment":{"url":"https://api.github.com/repos/cakephp/cakephp/issues/comments/165134726","html_url":"https://github.com/cakephp/cakephp/issues/7307#issuecomment-165134726","issue_url":"https://api.github.com/repos/cakephp/cakephp/issues/7307","id":165134726,"user":{"login":"Laykou","id":2313005,"avatar_url":"https://avatars.githubusercontent.com/u/2313005?v=3","gravatar_id":"","url":"https://api.github.com/users/Laykou","html_url":"https://github.com/Laykou","followers_url":"https://api.github.com/users/Laykou/followers","following_url":"https://api.github.com/users/Laykou/following{/other_user}","gists_url":"https://api.github.com/users/Laykou/gists{/gist_id}","starred_url":"https://api.github.com/users/Laykou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Laykou/subscriptions","organizations_url":"https://api.github.com/users/Laykou/orgs","repos_url":"https://api.github.com/users/Laykou/repos","events_url":"https://api.github.com/users/Laykou/events{/privacy}","received_events_url":"https://api.github.com/users/Laykou/received_events","type":"User","site_admin":false},"created_at":"2015-12-16T15:04:09Z","updated_at":"2015-12-16T15:04:09Z","body":"I understand the benefit of having `Elements` folder - when different views, e.g. `Articles` and `Users` use the same `helpbox.ctp` than it is pretty reasonable that the file resides in `Element/helpbox.ctp`.\r\n\r\nBut when I have `Articles/add.ctp`, `Articles/edit.ctp`, `Articles/third.ctp` and all of them are using `form.ctp` and this `form.ctp` is not being used from other views, then I do not see a reason to put it outside of this folder. It only makes more mess in the folder structure for me. Therefore I would like to keep it together in `Articles/` folder as `Articles/form.ctp` or `Articles/_form.ctp` or whatever works for the core team.\r\n\r\nI do not have any requirements for this but to have all files view for one Model in one folder to keep the code clean. Any other conventions are up to the core team :smile: and I just propsed some suggestions in the discussions but it is still open for any changes "}}