The new Dotkernel 6.0 version contains some new architectural changes compared to it's older version that uses controllers. The goal of this update is to implement PSR-15 handlers into Dotkernel API.
In DotKernel 6.0, a "handler" is the piece of code that reacts when a user makes a specific request (like visiting a webpage or submitting a form). It's basically the "controller" that decides what happens next.
HTTP request handlers are at the core of any web application. They receive a request, process it and return a response.
Controllers with several actions are fine, but handlers split the code into manageable chunks that make your life a lot easier in the long run. This follows the first of the SOLID principles.
A naming pattern helps you organize and quickly identify your files by using relevant strings in file names like:
The naming pattern for our Handlers contains:
In this way, the developer can easily figure out the functionality of each handler by looking at its name.
The full mapping of the handlers and their current paths and actions can be found here.