{"action":"closed","issue":{"url":"https://api.github.com/repos/cakephp/cakephp/issues/6322","labels_url":"https://api.github.com/repos/cakephp/cakephp/issues/6322/labels{/name}","comments_url":"https://api.github.com/repos/cakephp/cakephp/issues/6322/comments","events_url":"https://api.github.com/repos/cakephp/cakephp/issues/6322/events","html_url":"https://github.com/cakephp/cakephp/issues/6322","id":67919574,"number":6322,"title":"How I can extend view from regular View directory in my current theme?","user":{"login":"K4T","id":379159,"avatar_url":"https://avatars.githubusercontent.com/u/379159?v=3","gravatar_id":"","url":"https://api.github.com/users/K4T","html_url":"https://github.com/K4T","followers_url":"https://api.github.com/users/K4T/followers","following_url":"https://api.github.com/users/K4T/following{/other_user}","gists_url":"https://api.github.com/users/K4T/gists{/gist_id}","starred_url":"https://api.github.com/users/K4T/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/K4T/subscriptions","organizations_url":"https://api.github.com/users/K4T/orgs","repos_url":"https://api.github.com/users/K4T/repos","events_url":"https://api.github.com/users/K4T/events{/privacy}","received_events_url":"https://api.github.com/users/K4T/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/cakephp/cakephp/labels/Question","name":"Question","color":"207de5"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-04-12T14:05:46Z","updated_at":"2015-04-12T14:14:50Z","closed_at":"2015-04-12T14:14:50Z","body":"Hi! Let`s say I have following structure:\r\n\r\nRegular view: /View/Layouts/default.ctp\r\nTheme: /View/Themed/ThemeA/Layouts/default.ctp\r\nTheme: /View/Themed/ThemeB/Layouts/default.ctp\r\n\r\nIn my themes I want to extend default.ctp from regular view but I can not.\r\nWhen I try to do:\r\n\r\n/View/Themed/ThemeA/Layouts/default.ctp\r\n```php\r\n$this->extend('/Layouts/default');\r\necho $this->fetch('content');\r\n```\r\n\r\nI will receive error \"You cannot have views extend themselves.\". And of course it is true. But how I can solve that problem? I really need to extend my regular views (not only layouts templates) in my themes because I don`t want to duplicate code. Is it possible?\r\n\r\nWhat I am trying to do?\r\nIn my regular views I defined some blocks, for example:\r\n\r\nView/Products/index.ctp\r\n```php\r\n...\r\n   echo $this->fetch('theme_banner');\r\n...\r\n```\r\n\r\nNow I want to fill that block, which is defined in regular view, with data from current THEME, but I can not because I can not extend that regular view. I tried this:\r\n\r\nView/Themed/ThemeA/Products/index\r\n```php\r\n$this->extend('/Products/index');\r\n\r\n$this->start('theme_banner');\r\n    echo 'TEST';\r\n$this->end();\r\n```\r\n\r\nOf course I will get error again. Any help, please?\r\n\r\nSolution proposition:\r\nAdd some kind of flag to extend() method which allow developers to choose that they want to use view from reguler View directory or just from current theme. "}}