{"action":"created","issue":{"url":"https://api.github.com/repos/slimphp/Slim/issues/1510","labels_url":"https://api.github.com/repos/slimphp/Slim/issues/1510/labels{/name}","comments_url":"https://api.github.com/repos/slimphp/Slim/issues/1510/comments","events_url":"https://api.github.com/repos/slimphp/Slim/issues/1510/events","html_url":"https://github.com/slimphp/Slim/issues/1510","id":108939217,"number":1510,"title":"Container Information can not be access in custom classes","user":{"login":"xMolchy","id":14833565,"avatar_url":"https://avatars.githubusercontent.com/u/14833565?v=3","gravatar_id":"","url":"https://api.github.com/users/xMolchy","html_url":"https://github.com/xMolchy","followers_url":"https://api.github.com/users/xMolchy/followers","following_url":"https://api.github.com/users/xMolchy/following{/other_user}","gists_url":"https://api.github.com/users/xMolchy/gists{/gist_id}","starred_url":"https://api.github.com/users/xMolchy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xMolchy/subscriptions","organizations_url":"https://api.github.com/users/xMolchy/orgs","repos_url":"https://api.github.com/users/xMolchy/repos","events_url":"https://api.github.com/users/xMolchy/events{/privacy}","received_events_url":"https://api.github.com/users/xMolchy/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/slimphp/Slim/labels/Slim%203","name":"Slim 3","color":"009800"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-09-29T19:12:41Z","updated_at":"2015-09-29T19:47:09Z","closed_at":"2015-09-29T19:18:31Z","body":"For example not everyone wants all classes to be in a Container, i think most people will put in the ones that are commonly used like \"view\", \"log\", \"db\" ...\r\n\r\nSo not everyone will want to define and pass container instance into the class:\r\n$container['Action'] = function ($container) {\r\n    return new Action($container);\r\n};\r\n\r\nWhat if class is autoloaded and i just wanna do: $app->get('/', 'Action:dispatch');\r\nIn this aproache without above definition container does not get avaible inside custom class ...\r\n\r\nFILE: CallableResolver.php\r\nCHANGE: $resolved = [new $class($this->container), $method];"},"comment":{"url":"https://api.github.com/repos/slimphp/Slim/issues/comments/144168642","html_url":"https://github.com/slimphp/Slim/issues/1510#issuecomment-144168642","issue_url":"https://api.github.com/repos/slimphp/Slim/issues/1510","id":144168642,"user":{"login":"xMolchy","id":14833565,"avatar_url":"https://avatars.githubusercontent.com/u/14833565?v=3","gravatar_id":"","url":"https://api.github.com/users/xMolchy","html_url":"https://github.com/xMolchy","followers_url":"https://api.github.com/users/xMolchy/followers","following_url":"https://api.github.com/users/xMolchy/following{/other_user}","gists_url":"https://api.github.com/users/xMolchy/gists{/gist_id}","starred_url":"https://api.github.com/users/xMolchy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xMolchy/subscriptions","organizations_url":"https://api.github.com/users/xMolchy/orgs","repos_url":"https://api.github.com/users/xMolchy/repos","events_url":"https://api.github.com/users/xMolchy/events{/privacy}","received_events_url":"https://api.github.com/users/xMolchy/received_events","type":"User","site_admin":false},"created_at":"2015-09-29T19:47:08Z","updated_at":"2015-09-29T19:47:08Z","body":"I understand why is final no issues there ... but why allow passing container into functions of the route but not the class-es ? explanation why is bad design ?\r\n\r\nTy for:\r\n$container['callableResolver'] = function ($c) {\r\n    return new MyOwnCallableResolver($c);\r\n}\r\n\r\n;) did not know can do that ... can i use the same for \"Route\" to extend some chain functions ... for example route validation also which container i wish to pass into specified routes (depands which application what needs) ?\r\n\r\nTy already extended personal knowledge ;)"}}