klein / klein.php

A fast & flexible router
MIT License
2.66k stars 290 forks source link

Added documentation on how to fix browser console logging components. #289

Open jamesvl opened 9 years ago

jamesvl commented 9 years ago

I spent a couple of hours trying to figure out why several different Monolog handlers weren't working with my site using Klein. Finally dove into the source code of each to figure out it was a send_headers() type of issue.

The fix is to use Klein's afterDispatch() method, which is otherwise unmentioned in the Readme file or the PHPDocs.

I'm not sure of the best place for this in the docs, so chose a section that seemed to fit okay. Feel free to move it around, or leave it out entirely if the method isn't meant for general use.