{"action":"created","comment":{"url":"https://api.github.com/repos/y-mizo/LoginBase/pulls/comments/91103652","pull_request_review_id":11612415,"id":91103652,"diff_hunk":"@@ -21,47 +21,65 @@\n  */\n class PagesController extends AppController {\n \n-/**\n- * This controller does not use a model\n- *\n- * @var array\n- */\n-\tpublic $uses = array();\n+    /**\n+     * This controller does not use a model\n+     *\n+     * @var array\n+     */\n+    public $uses = array();\n \n-/**\n- * Displays a view\n- *\n- * @return void\n- * @throws NotFoundException When the view file could not be found\n- *   or MissingViewException in debug mode.\n- */\n-\tpublic function display() {\n-\t\t$path = func_get_args();\n+    /**\n+     * Displays a view\n+     *\n+     * @return void\n+     * @throws NotFoundException When the view file could not be found\n+     *   or MissingViewException in debug mode.\n+     */\n+    public function display() {\n+        $path = func_get_args();\n+\n+        $count = count($path);\n+        if (!$count) {\n+            return $this->redirect('/');\n+        }\n+        $page = $subpage = $title_for_layout = null;\n+\n+        if (!empty($path[0])) {\n+            $page = $path[0];\n+        }\n+        if (!empty($path[1])) {\n+            $subpage = $path[1];\n+        }\n+        if (!empty($path[$count - 1])) {\n+            $title_for_layout = Inflector::humanize($path[$count - 1]);\n+        }\n+        $this->set(compact('page', 'subpage', 'title_for_layout'));\n+\n+        try {\n+            $this->render(implode('/', $path));\n+        } catch (MissingViewException $e) {\n+            if (Configure::read('debug')) {\n+                throw $e;\n+            }\n+            throw new NotFoundException();\n+        }\n+    }\n \n-\t\t$count = count($path);\n-\t\tif (!$count) {\n-\t\t\treturn $this->redirect('/');\n-\t\t}\n-\t\t$page = $subpage = $title_for_layout = null;\n+    public function beforeFilter() {\n+        parent::beforeFilter();\n+        $this->Auth->allow('display', 'home');\n+    }\n+    \n+    public function page1() {","path":"Controller/PagesController.php","position":87,"original_position":87,"commit_id":"fff80e1b77281b44fd0300451029cccff62fe3a7","original_commit_id":"bea84d4ca29b4a561fc6b3b1afcbccc3e5e01a16","user":{"login":"nw-tsubo","id":18205108,"avatar_url":"https://avatars.githubusercontent.com/u/18205108?v=3","gravatar_id":"","url":"https://api.github.com/users/nw-tsubo","html_url":"https://github.com/nw-tsubo","followers_url":"https://api.github.com/users/nw-tsubo/followers","following_url":"https://api.github.com/users/nw-tsubo/following{/other_user}","gists_url":"https://api.github.com/users/nw-tsubo/gists{/gist_id}","starred_url":"https://api.github.com/users/nw-tsubo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nw-tsubo/subscriptions","organizations_url":"https://api.github.com/users/nw-tsubo/orgs","repos_url":"https://api.github.com/users/nw-tsubo/repos","events_url":"https://api.github.com/users/nw-tsubo/events{/privacy}","received_events_url":"https://api.github.com/users/nw-tsubo/received_events","type":"User","site_admin":false},"body":"page1(), page2(), page3() メソッドはすべて不要です。\r\ndisplay() の中でやっていることをよく見直して、display() の役割と上記の3つのメソッドが不要な訳を考えてみてください。\r\nまた、 `Config/route.php` 内の以下のルートの意味も考えてみてください。とくに `/pages/*` となっているところ。\r\n\r\n```\r\nRouter::connect('/pages/*', array('controller' => 'pages', 'action' => 'display'));\r\n```","created_at":"2016-12-06T15:41:35Z","updated_at":"2016-12-06T15:44:18Z","html_url":"https://github.com/y-mizo/LoginBase/pull/1#discussion_r91103652","pull_request_url":"https://api.github.com/repos/y-mizo/LoginBase/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/y-mizo/LoginBase/pulls/comments/91103652"},"html":{"href":"https://github.com/y-mizo/LoginBase/pull/1#discussion_r91103652"},"pull_request":{"href":"https://api.github.com/repos/y-mizo/LoginBase/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/y-mizo/LoginBase/pulls/1","id":96646931,"html_url":"https://github.com/y-mizo/LoginBase/pull/1","diff_url":"https://github.com/y-mizo/LoginBase/pull/1.diff","patch_url":"https://github.com/y-mizo/LoginBase/pull/1.patch","issue_url":"https://api.github.com/repos/y-mizo/LoginBase/issues/1","number":1,"state":"open","locked":false,"title":"Dev","user":{"login":"y-mizo","id":22143827,"avatar_url":"https://avatars.githubusercontent.com/u/22143827?v=3","gravatar_id":"","url":"https://api.github.com/users/y-mizo","html_url":"https://github.com/y-mizo","followers_url":"https://api.github.com/users/y-mizo/followers","following_url":"https://api.github.com/users/y-mizo/following{/other_user}","gists_url":"https://api.github.com/users/y-mizo/gists{/gist_id}","starred_url":"https://api.github.com/users/y-mizo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/y-mizo/subscriptions","organizations_url":"https://api.github.com/users/y-mizo/orgs","repos_url":"https://api.github.com/users/y-mizo/repos","events_url":"https://api.github.com/users/y-mizo/events{/privacy}","received_events_url":"https://api.github.com/users/y-mizo/received_events","type":"User","site_admin":false},"body":"<質問>\r\n・AppControllerの「'authError' => 'Please log in.'」が効いていない気がします。\r\n   何が原因でしょうか?\r\n・コミットメッセージの直し方はありますか?","created_at":"2016-12-06T01:58:12Z","updated_at":"2016-12-06T15:44:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4919b8fa75bc337e5beb3b5d1d65f9422e94cc39","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/y-mizo/LoginBase/pulls/1/commits","review_comments_url":"https://api.github.com/repos/y-mizo/LoginBase/pulls/1/comments","review_comment_url":"https://api.github.com/repos/y-mizo/LoginBase/pulls/comments{/number}","comments_url":"https://api.github.com/repos/y-mizo/LoginBase/issues/1/comments","statuses_url":"https://api.github.com/repos/y-mizo/LoginBase/statuses/fff80e1b77281b44fd0300451029cccff62fe3a7","head":{"label":"y-mizo:dev","ref":"dev","sha":"fff80e1b77281b44fd0300451029cccff62fe3a7","user":{"login":"y-mizo","id":22143827,"avatar_url":"https://avatars.githubusercontent.com/u/22143827?v=3","gravatar_id":"","url":"https://api.github.com/users/y-mizo","html_url":"https://github.com/y-mizo","followers_url":"https://api.github.com/users/y-mizo/followers","following_url":"https://api.github.com/users/y-mizo/following{/other_user}","gists_url":"https://api.github.com/users/y-mizo/gists{/gist_id}","starred_url":"https://api.github.com/users/y-mizo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/y-mizo/subscriptions","organizations_url":"https://api.github.com/users/y-mizo/orgs","repos_url":"https://api.github.com/users/y-mizo/repos","events_url":"https://api.github.com/users/y-mizo/events{/privacy}","received_events_url":"https://api.github.com/users/y-mizo/received_events","type":"User","site_admin":false},"repo":{"id":75523275,"name":"LoginBase","full_name":"y-mizo/LoginBase","owner":{"login":"y-mizo","id":22143827,"avatar_url":"https://avatars.githubusercontent.com/u/22143827?v=3","gravatar_id":"","url":"https://api.github.com/users/y-mizo","html_url":"https://github.com/y-mizo","followers_url":"https://api.github.com/users/y-mizo/followers","following_url":"https://api.github.com/users/y-mizo/following{/other_user}","gists_url":"https://api.github.com/users/y-mizo/gists{/gist_id}","starred_url":"https://api.github.com/users/y-mizo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/y-mizo/subscriptions","organizations_url":"https://api.github.com/users/y-mizo/orgs","repos_url":"https://api.github.com/users/y-mizo/repos","events_url":"https://api.github.com/users/y-mizo/events{/privacy}","received_events_url":"https://api.github.com/users/y-mizo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/y-mizo/LoginBase","description":null,"fork":false,"url":"https://api.github.com/repos/y-mizo/LoginBase","forks_url":"https://api.github.com/repos/y-mizo/LoginBase/forks","keys_url":"https://api.github.com/repos/y-mizo/LoginBase/keys{/key_id}","collaborators_url":"https://api.github.com/repos/y-mizo/LoginBase/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/y-mizo/LoginBase/teams","hooks_url":"https://api.github.com/repos/y-mizo/LoginBase/hooks","issue_events_url":"https://api.github.com/repos/y-mizo/LoginBase/issues/events{/number}","events_url":"https://api.github.com/repos/y-mizo/LoginBase/events","assignees_url":"https://api.github.com/repos/y-mizo/LoginBase/assignees{/user}","branches_url":"https://api.github.com/repos/y-mizo/LoginBase/branches{/branch}","tags_url":"https://api.github.com/repos/y-mizo/LoginBase/tags","blobs_url":"https://api.github.com/repos/y-mizo/LoginBase/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/y-mizo/LoginBase/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/y-mizo/LoginBase/git/refs{/sha}","trees_url":"https://api.github.com/repos/y-mizo/LoginBase/git/trees{/sha}","statuses_url":"https://api.github.com/repos/y-mizo/LoginBase/statuses/{sha}","languages_url":"https://api.github.com/repos/y-mizo/LoginBase/languages","stargazers_url":"https://api.github.com/repos/y-mizo/LoginBase/stargazers","contributors_url":"https://api.github.com/repos/y-mizo/LoginBase/contributors","subscribers_url":"https://api.github.com/repos/y-mizo/LoginBase/subscribers","subscription_url":"https://api.github.com/repos/y-mizo/LoginBase/subscription","commits_url":"https://api.github.com/repos/y-mizo/LoginBase/commits{/sha}","git_commits_url":"https://api.github.com/repos/y-mizo/LoginBase/git/commits{/sha}","comments_url":"https://api.github.com/repos/y-mizo/LoginBase/comments{/number}","issue_comment_url":"https://api.github.com/repos/y-mizo/LoginBase/issues/comments{/number}","contents_url":"https://api.github.com/repos/y-mizo/LoginBase/contents/{+path}","compare_url":"https://api.github.com/repos/y-mizo/LoginBase/compare/{base}...{head}","merges_url":"https://api.github.com/repos/y-mizo/LoginBase/merges","archive_url":"https://api.github.com/repos/y-mizo/LoginBase/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/y-mizo/LoginBase/downloads","issues_url":"https://api.github.com/repos/y-mizo/LoginBase/issues{/number}","pulls_url":"https://api.github.com/repos/y-mizo/LoginBase/pulls{/number}","milestones_url":"https://api.github.com/repos/y-mizo/LoginBase/milestones{/number}","notifications_url":"https://api.github.com/repos/y-mizo/LoginBase/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/y-mizo/LoginBase/labels{/name}","releases_url":"https://api.github.com/repos/y-mizo/LoginBase/releases{/id}","deployments_url":"https://api.github.com/repos/y-mizo/LoginBase/deployments","created_at":"2016-12-04T07:18:57Z","updated_at":"2016-12-04T07:20:36Z","pushed_at":"2016-12-06T11:17:03Z","git_url":"git://github.com/y-mizo/LoginBase.git","ssh_url":"git@github.com:y-mizo/LoginBase.git","clone_url":"https://github.com/y-mizo/LoginBase.git","svn_url":"https://github.com/y-mizo/LoginBase","homepage":null,"size":56,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"y-mizo:master","ref":"master","sha":"b885f20aa8ed4f9b6abf1a4018060d726ca460d8","user":{"login":"y-mizo","id":22143827,"avatar_url":"https://avatars.githubusercontent.com/u/22143827?v=3","gravatar_id":"","url":"https://api.github.com/users/y-mizo","html_url":"https://github.com/y-mizo","followers_url":"https://api.github.com/users/y-mizo/followers","following_url":"https://api.github.com/users/y-mizo/following{/other_user}","gists_url":"https://api.github.com/users/y-mizo/gists{/gist_id}","starred_url":"https://api.github.com/users/y-mizo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/y-mizo/subscriptions","organizations_url":"https://api.github.com/users/y-mizo/orgs","repos_url":"https://api.github.com/users/y-mizo/repos","events_url":"https://api.github.com/users/y-mizo/events{/privacy}","received_events_url":"https://api.github.com/users/y-mizo/received_events","type":"User","site_admin":false},"repo":{"id":75523275,"name":"LoginBase","full_name":"y-mizo/LoginBase","owner":{"login":"y-mizo","id":22143827,"avatar_url":"https://avatars.githubusercontent.com/u/22143827?v=3","gravatar_id":"","url":"https://api.github.com/users/y-mizo","html_url":"https://github.com/y-mizo","followers_url":"https://api.github.com/users/y-mizo/followers","following_url":"https://api.github.com/users/y-mizo/following{/other_user}","gists_url":"https://api.github.com/users/y-mizo/gists{/gist_id}","starred_url":"https://api.github.com/users/y-mizo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/y-mizo/subscriptions","organizations_url":"https://api.github.com/users/y-mizo/orgs","repos_url":"https://api.github.com/users/y-mizo/repos","events_url":"https://api.github.com/users/y-mizo/events{/privacy}","received_events_url":"https://api.github.com/users/y-mizo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/y-mizo/LoginBase","description":null,"fork":false,"url":"https://api.github.com/repos/y-mizo/LoginBase","forks_url":"https://api.github.com/repos/y-mizo/LoginBase/forks","keys_url":"https://api.github.com/repos/y-mizo/LoginBase/keys{/key_id}","collaborators_url":"https://api.github.com/repos/y-mizo/LoginBase/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/y-mizo/LoginBase/teams","hooks_url":"https://api.github.com/repos/y-mizo/LoginBase/hooks","issue_events_url":"https://api.github.com/repos/y-mizo/LoginBase/issues/events{/number}","events_url":"https://api.github.com/repos/y-mizo/LoginBase/events","assignees_url":"https://api.github.com/repos/y-mizo/LoginBase/assignees{/user}","branches_url":"https://api.github.com/repos/y-mizo/LoginBase/branches{/branch}","tags_url":"https://api.github.com/repos/y-mizo/LoginBase/tags","blobs_url":"https://api.github.com/repos/y-mizo/LoginBase/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/y-mizo/LoginBase/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/y-mizo/LoginBase/git/refs{/sha}","trees_url":"https://api.github.com/repos/y-mizo/LoginBase/git/trees{/sha}","statuses_url":"https://api.github.com/repos/y-mizo/LoginBase/statuses/{sha}","languages_url":"https://api.github.com/repos/y-mizo/LoginBase/languages","stargazers_url":"https://api.github.com/repos/y-mizo/LoginBase/stargazers","contributors_url":"https://api.github.com/repos/y-mizo/LoginBase/contributors","subscribers_url":"https://api.github.com/repos/y-mizo/LoginBase/subscribers","subscription_url":"https://api.github.com/repos/y-mizo/LoginBase/subscription","commits_url":"https://api.github.com/repos/y-mizo/LoginBase/commits{/sha}","git_commits_url":"https://api.github.com/repos/y-mizo/LoginBase/git/commits{/sha}","comments_url":"https://api.github.com/repos/y-mizo/LoginBase/comments{/number}","issue_comment_url":"https://api.github.com/repos/y-mizo/LoginBase/issues/comments{/number}","contents_url":"https://api.github.com/repos/y-mizo/LoginBase/contents/{+path}","compare_url":"https://api.github.com/repos/y-mizo/LoginBase/compare/{base}...{head}","merges_url":"https://api.github.com/repos/y-mizo/LoginBase/merges","archive_url":"https://api.github.com/repos/y-mizo/LoginBase/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/y-mizo/LoginBase/downloads","issues_url":"https://api.github.com/repos/y-mizo/LoginBase/issues{/number}","pulls_url":"https://api.github.com/repos/y-mizo/LoginBase/pulls{/number}","milestones_url":"https://api.github.com/repos/y-mizo/LoginBase/milestones{/number}","notifications_url":"https://api.github.com/repos/y-mizo/LoginBase/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/y-mizo/LoginBase/labels{/name}","releases_url":"https://api.github.com/repos/y-mizo/LoginBase/releases{/id}","deployments_url":"https://api.github.com/repos/y-mizo/LoginBase/deployments","created_at":"2016-12-04T07:18:57Z","updated_at":"2016-12-04T07:20:36Z","pushed_at":"2016-12-06T11:17:03Z","git_url":"git://github.com/y-mizo/LoginBase.git","ssh_url":"git@github.com:y-mizo/LoginBase.git","clone_url":"https://github.com/y-mizo/LoginBase.git","svn_url":"https://github.com/y-mizo/LoginBase","homepage":null,"size":56,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/y-mizo/LoginBase/pulls/1"},"html":{"href":"https://github.com/y-mizo/LoginBase/pull/1"},"issue":{"href":"https://api.github.com/repos/y-mizo/LoginBase/issues/1"},"comments":{"href":"https://api.github.com/repos/y-mizo/LoginBase/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/y-mizo/LoginBase/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/y-mizo/LoginBase/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/y-mizo/LoginBase/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/y-mizo/LoginBase/statuses/fff80e1b77281b44fd0300451029cccff62fe3a7"}}}}
{"actor":{"display_login":"nw-tsubo"}}