{"action":"created","issue":{"url":"https://api.github.com/repos/chriskacerguis/codeigniter-restserver/issues/716","repository_url":"https://api.github.com/repos/chriskacerguis/codeigniter-restserver","labels_url":"https://api.github.com/repos/chriskacerguis/codeigniter-restserver/issues/716/labels{/name}","comments_url":"https://api.github.com/repos/chriskacerguis/codeigniter-restserver/issues/716/comments","events_url":"https://api.github.com/repos/chriskacerguis/codeigniter-restserver/issues/716/events","html_url":"https://github.com/chriskacerguis/codeigniter-restserver/issues/716","id":183275036,"number":716,"title":"A fix for index methods","user":{"login":"AmitMY","id":5757359,"avatar_url":"https://avatars.githubusercontent.com/u/5757359?v=3","gravatar_id":"","url":"https://api.github.com/users/AmitMY","html_url":"https://github.com/AmitMY","followers_url":"https://api.github.com/users/AmitMY/followers","following_url":"https://api.github.com/users/AmitMY/following{/other_user}","gists_url":"https://api.github.com/users/AmitMY/gists{/gist_id}","starred_url":"https://api.github.com/users/AmitMY/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AmitMY/subscriptions","organizations_url":"https://api.github.com/users/AmitMY/orgs","repos_url":"https://api.github.com/users/AmitMY/repos","events_url":"https://api.github.com/users/AmitMY/events{/privacy}","received_events_url":"https://api.github.com/users/AmitMY/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"chriskacerguis","id":2414647,"avatar_url":"https://avatars.githubusercontent.com/u/2414647?v=3","gravatar_id":"","url":"https://api.github.com/users/chriskacerguis","html_url":"https://github.com/chriskacerguis","followers_url":"https://api.github.com/users/chriskacerguis/followers","following_url":"https://api.github.com/users/chriskacerguis/following{/other_user}","gists_url":"https://api.github.com/users/chriskacerguis/gists{/gist_id}","starred_url":"https://api.github.com/users/chriskacerguis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chriskacerguis/subscriptions","organizations_url":"https://api.github.com/users/chriskacerguis/orgs","repos_url":"https://api.github.com/users/chriskacerguis/repos","events_url":"https://api.github.com/users/chriskacerguis/events{/privacy}","received_events_url":"https://api.github.com/users/chriskacerguis/received_events","type":"User","site_admin":false},"assignees":[{"login":"chriskacerguis","id":2414647,"avatar_url":"https://avatars.githubusercontent.com/u/2414647?v=3","gravatar_id":"","url":"https://api.github.com/users/chriskacerguis","html_url":"https://github.com/chriskacerguis","followers_url":"https://api.github.com/users/chriskacerguis/followers","following_url":"https://api.github.com/users/chriskacerguis/following{/other_user}","gists_url":"https://api.github.com/users/chriskacerguis/gists{/gist_id}","starred_url":"https://api.github.com/users/chriskacerguis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chriskacerguis/subscriptions","organizations_url":"https://api.github.com/users/chriskacerguis/orgs","repos_url":"https://api.github.com/users/chriskacerguis/repos","events_url":"https://api.github.com/users/chriskacerguis/events{/privacy}","received_events_url":"https://api.github.com/users/chriskacerguis/received_events","type":"User","site_admin":false}],"milestone":null,"comments":4,"created_at":"2016-10-16T16:10:12Z","updated_at":"2016-10-30T08:52:41Z","closed_at":null,"body":"If I write a method `index_get($param)`, the only way to access is `controller/index` in a `GET` request\r\n\r\nI am not sure if this is intended, or just because I use HMVC (like I guess most user do).\r\n\r\nHere is a quick fix for that:\r\nIn `_remap`:\r\nAfter:\r\n`$controller_method = $object_called . '_' . $this->request->method;`\r\nAdd\r\n```\r\n if (!method_exists($this, $controller_method)) {\r\n\t$controller_method = \"index_\" . $this->request->method;\r\n\tarray_unshift($arguments, $object_called);\r\n}\r\n```\r\n\r\nThis does not remove the option to access `controller/index/:param`\r\nBut allows the normal access way of `controller/:param`\r\n\r\n---\r\n\r\nAlso, when we `call_user_func_array`, there should be a `try:catch`\r\nSomething like:\r\n```\r\ntry {\r\n    call_user_func_array([$this, $controller_method], $arguments);\r\n} catch (Exception $ex) {\r\n    $this->response_ex($ex);\r\n}\r\n```\r\n\r\nSorry if my explanation is bad. If so, I'll try to explain again\r\n\r\nI can't create a pull request in this time, hope you'll add it"},"comment":{"url":"https://api.github.com/repos/chriskacerguis/codeigniter-restserver/issues/comments/257139482","html_url":"https://github.com/chriskacerguis/codeigniter-restserver/issues/716#issuecomment-257139482","issue_url":"https://api.github.com/repos/chriskacerguis/codeigniter-restserver/issues/716","id":257139482,"user":{"login":"Dekadencee","id":965653,"avatar_url":"https://avatars.githubusercontent.com/u/965653?v=3","gravatar_id":"","url":"https://api.github.com/users/Dekadencee","html_url":"https://github.com/Dekadencee","followers_url":"https://api.github.com/users/Dekadencee/followers","following_url":"https://api.github.com/users/Dekadencee/following{/other_user}","gists_url":"https://api.github.com/users/Dekadencee/gists{/gist_id}","starred_url":"https://api.github.com/users/Dekadencee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Dekadencee/subscriptions","organizations_url":"https://api.github.com/users/Dekadencee/orgs","repos_url":"https://api.github.com/users/Dekadencee/repos","events_url":"https://api.github.com/users/Dekadencee/events{/privacy}","received_events_url":"https://api.github.com/users/Dekadencee/received_events","type":"User","site_admin":false},"created_at":"2016-10-30T08:52:41Z","updated_at":"2016-10-30T08:52:41Z","body":"Tested and working, thanks @AmitMY"}}
{"actor":{"display_login":"Dekadencee"}}