{"action":"reopened","issue":{"url":"https://api.github.com/repos/slimphp/Slim/issues/1336","labels_url":"https://api.github.com/repos/slimphp/Slim/issues/1336/labels{/name}","comments_url":"https://api.github.com/repos/slimphp/Slim/issues/1336/comments","events_url":"https://api.github.com/repos/slimphp/Slim/issues/1336/events","html_url":"https://github.com/slimphp/Slim/issues/1336","id":92842724,"number":1336,"title":"v3 docs containers","user":{"login":"Lewiscowles1986","id":2605791,"avatar_url":"https://avatars.githubusercontent.com/u/2605791?v=3","gravatar_id":"","url":"https://api.github.com/users/Lewiscowles1986","html_url":"https://github.com/Lewiscowles1986","followers_url":"https://api.github.com/users/Lewiscowles1986/followers","following_url":"https://api.github.com/users/Lewiscowles1986/following{/other_user}","gists_url":"https://api.github.com/users/Lewiscowles1986/gists{/gist_id}","starred_url":"https://api.github.com/users/Lewiscowles1986/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lewiscowles1986/subscriptions","organizations_url":"https://api.github.com/users/Lewiscowles1986/orgs","repos_url":"https://api.github.com/users/Lewiscowles1986/repos","events_url":"https://api.github.com/users/Lewiscowles1986/events{/privacy}","received_events_url":"https://api.github.com/users/Lewiscowles1986/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-03T10:15:15Z","updated_at":"2015-07-03T16:00:14Z","closed_at":null,"body":"In the v3 docs when describing how to setup a custom handler for 404, the code provided does not work, and is ambiguous.\r\n\r\n```php\r\n$app['notFoundHandler'] = function ($c) { return function ($request, $response) use ($c) { return $c['response']->withStatus(404) ->withHeader('Content-Type', 'text/html') ->write('Page not found'); }; };\r\n```\r\n\r\nIt should be\r\n```PHP\r\n$c = new \\Slim\\Container();\r\n$c['notFoundHandler'] = function ($c) {\r\n    return function ($request, $response) use ($c) {\r\n        return $c['response']->withStatus(404) ->withHeader('Content-Type', 'text/html') ->write('Page not found');\r\n        };\r\n};\r\n$app = new \\Slim\\App($c);\r\n```\r\nThis way you show syntax, add context, and due to the formatting, it's easier to read what it does.\r\n\r\nOther things I think would be cool to document would be that without return in the callback, you will get an error, and as many exceptions as can be documented as to possible root causes.\r\n\r\nOf course, I am happy to document, but there is a part-2 (sorry)\r\n\r\nIt might also be good to add some helper methods to the app `notFound` method, `error` method, and `notAllowed` method in `\\Slim\\App` would make this super-easy to read and understand; just for ease of use and readability.\r\n\r\n:crying_cat_face: \r\n[Slim v2 had it](http://docs.slimframework.com/errors/404/)"}}