{"action":"created","issue":{"url":"https://api.github.com/repos/OmarElGabry/miniPHP/issues/9","repository_url":"https://api.github.com/repos/OmarElGabry/miniPHP","labels_url":"https://api.github.com/repos/OmarElGabry/miniPHP/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/OmarElGabry/miniPHP/issues/9/comments","events_url":"https://api.github.com/repos/OmarElGabry/miniPHP/issues/9/events","html_url":"https://github.com/OmarElGabry/miniPHP/issues/9","id":155606539,"number":9,"title":"Controller.php model loader (class not found)","user":{"login":"Creeall","id":1867683,"avatar_url":"https://avatars.githubusercontent.com/u/1867683?v=3","gravatar_id":"","url":"https://api.github.com/users/Creeall","html_url":"https://github.com/Creeall","followers_url":"https://api.github.com/users/Creeall/followers","following_url":"https://api.github.com/users/Creeall/following{/other_user}","gists_url":"https://api.github.com/users/Creeall/gists{/gist_id}","starred_url":"https://api.github.com/users/Creeall/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Creeall/subscriptions","organizations_url":"https://api.github.com/users/Creeall/orgs","repos_url":"https://api.github.com/users/Creeall/repos","events_url":"https://api.github.com/users/Creeall/events{/privacy}","received_events_url":"https://api.github.com/users/Creeall/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2016-05-18T21:32:12Z","updated_at":"2016-06-09T06:17:21Z","closed_at":null,"body":"There might be an issue with :\r\nController.php\r\n\r\n```\r\npublic function loadModel($model){\r\n        return $this->{$model} = new $model();\r\n}\r\n```\r\n\r\n\r\nI get **class not found** when validating login form and the class name the app is looking for is \"login\" instead of \"Login\" (the model class).\r\n\r\nI made some change in the framwork to match my needs so it may as well be my own fault.\r\nBut just in case I think it's better to report this. So you can double check.\r\n\r\nThe fix for me was just to add the uc_words() to force an uppercase like this:\r\n\r\n```\r\npublic function loadModel($model){\r\n        $uc_model = ucwords($model);\r\n        return $this->{$model} = new $uc_model();\r\n}\r\n```\r\n\r\n\r\nAnd I get past the login form to the dashboard as expected now."},"comment":{"url":"https://api.github.com/repos/OmarElGabry/miniPHP/issues/comments/224809309","html_url":"https://github.com/OmarElGabry/miniPHP/issues/9#issuecomment-224809309","issue_url":"https://api.github.com/repos/OmarElGabry/miniPHP/issues/9","id":224809309,"user":{"login":"creative-coder","id":637336,"avatar_url":"https://avatars.githubusercontent.com/u/637336?v=3","gravatar_id":"","url":"https://api.github.com/users/creative-coder","html_url":"https://github.com/creative-coder","followers_url":"https://api.github.com/users/creative-coder/followers","following_url":"https://api.github.com/users/creative-coder/following{/other_user}","gists_url":"https://api.github.com/users/creative-coder/gists{/gist_id}","starred_url":"https://api.github.com/users/creative-coder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/creative-coder/subscriptions","organizations_url":"https://api.github.com/users/creative-coder/orgs","repos_url":"https://api.github.com/users/creative-coder/repos","events_url":"https://api.github.com/users/creative-coder/events{/privacy}","received_events_url":"https://api.github.com/users/creative-coder/received_events","type":"User","site_admin":false},"created_at":"2016-06-09T06:17:21Z","updated_at":"2016-06-09T06:17:21Z","body":"upper camel case, a.k.a. PascalCase: ThisIsAnExample. thisIsNotAnExample.\r\nlower camel case: thisIsAnExample. ThisIsNotAnExample."}}
{"actor":{"display_login":"creative-coder"}}