Now customizations should go into Framework which is obviously not the case. Customizations like registering our Custom Error Handler. To solve this, we are going to use of Dependency Injection design pattern.
Framework would exist out of Custom eventlisteners and contrib code.
After framework assambled the response, just before returning it, the framework let the eventdispatcher class emit a ResponseEvent. This response event contains the request and response objects. Listeners to the event can access those objects and therefore can modify the response (adding stuff to it). Listeners need to be added to the eventdispatcher. A listener just need to be of type callable (a function will do). We can set the priority of the listeners to control which order they will be alerted.
…ollerResolver, part of http-kernel component.
Use matcher object to match a request and given routes. Make use of exception handling for 404 and other errors.
parse the arguments.
- Moved webroot to /web directory - Added htaccess file with rewriting to remove index.php from url - Hello and Bye scripts moved to pages dir - Hello and Bye script just outputs their contents, get captured by froncontroller which sets it as the response content.