{"action":"closed","issue":{"url":"https://api.github.com/repos/cakephp/cakephp/issues/6256","labels_url":"https://api.github.com/repos/cakephp/cakephp/issues/6256/labels{/name}","comments_url":"https://api.github.com/repos/cakephp/cakephp/issues/6256/comments","events_url":"https://api.github.com/repos/cakephp/cakephp/issues/6256/events","html_url":"https://github.com/cakephp/cakephp/issues/6256","id":65898575,"number":6256,"title":"Notice (8): Undefined variable: color [APP/Template\\Pages\\myshow.ctp, line 2]","user":{"login":"amitt800","id":6365896,"avatar_url":"https://avatars.githubusercontent.com/u/6365896?v=3","gravatar_id":"","url":"https://api.github.com/users/amitt800","html_url":"https://github.com/amitt800","followers_url":"https://api.github.com/users/amitt800/followers","following_url":"https://api.github.com/users/amitt800/following{/other_user}","gists_url":"https://api.github.com/users/amitt800/gists{/gist_id}","starred_url":"https://api.github.com/users/amitt800/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amitt800/subscriptions","organizations_url":"https://api.github.com/users/amitt800/orgs","repos_url":"https://api.github.com/users/amitt800/repos","events_url":"https://api.github.com/users/amitt800/events{/privacy}","received_events_url":"https://api.github.com/users/amitt800/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-04-02T10:21:28Z","updated_at":"2015-04-02T10:27:13Z","closed_at":"2015-04-02T10:27:13Z","body":"My code is:\r\n\r\n<?php\r\n/**\r\n * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)\r\n * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)\r\n *\r\n * Licensed under The MIT License\r\n * For full copyright and license information, please see the LICENSE.txt\r\n * Redistributions of files must retain the above copyright notice.\r\n *\r\n * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)\r\n * @link      http://cakephp.org CakePHP(tm) Project\r\n * @since     0.2.9\r\n * @license   http://www.opensource.org/licenses/mit-license.php MIT License\r\n */\r\nnamespace App\\Controller;\r\n\r\nuse Cake\\Core\\Configure;\r\nuse Cake\\Network\\Exception\\NotFoundException;\r\nuse Cake\\View\\Exception\\MissingTemplateException;\r\n\r\n/**\r\n * Static content controller\r\n *\r\n * This controller will render views from Template/Pages/\r\n *\r\n * @link http://book.cakephp.org/3.0/en/controllers/pages-controller.html\r\n */\r\nclass PagesController extends AppController\r\n{\r\n\r\n    /**\r\n     * Displays a view\r\n     *\r\n     * @return void|\\Cake\\Network\\Response\r\n     * @throws \\Cake\\Network\\Exception\\NotFoundException When the view file could not\r\n     *   be found or \\Cake\\View\\Exception\\MissingTemplateException in debug mode.\r\n     */\r\n    public function display()\r\n    {\r\n        $path = func_get_args();\r\n\r\n        $count = count($path);\r\n        if (!$count) {\r\n            return $this->redirect('/');\r\n        }\r\n        $page = $subpage = null;\r\n\r\n        if (!empty($path[0])) {\r\n            $page = $path[0];\r\n        }\r\n        if (!empty($path[1])) {\r\n            $subpage = $path[1];\r\n        }\r\n        $this->set(compact('page', 'subpage'));\r\n\r\n        try {\r\n            $this->render(implode('/', $path));\r\n        } catch (MissingTemplateException $e) {\r\n            if (Configure::read('debug')) {\r\n                throw $e;\r\n            }\r\n            throw new NotFoundException();\r\n        }\r\n    }\r\n\t\r\n\tpublic function myshow() {\r\n$this->set('color', 'pink');\r\n\r\n      $this->render();\r\n    }\r\n}\r\n==========================\r\nsrc\\Template\\Pages\\myshow.ctp\r\n\r\n<?php\r\necho $color;\r\n\r\n?>\r\ntest\r\n\r\n"}}